Skip to content

Latest commit

 

History

History
204 lines (146 loc) · 6.72 KB

README.md

File metadata and controls

204 lines (146 loc) · 6.72 KB

Modules

StrandpipeEventEmitter

The source of everything, control the flow of Async/Await and Promises function.

Threadify

Consist a bunch of stacked function to utilize Synchronous-ify API

Functions

Pipe()

The base of Strandpipe, consist of method for running and yielding synchronous jobs. Instance of Fibers/Coroutines.

Future()

The base of Future methods and stuff

Typedefs

ErrorType

Strandpipe ⇐ EventEmitter

The source of everything, control the flow of Async/Await and Promises function.

Extends: EventEmitter
Author: Riichi_Rusdiana#6815

Strandpipe~Strandpipe

Kind: inner class of Strandpipe

new Strandpipe()

Start a Strandpipe class Consist of function that will be used a lots in the Pipestream

strandpipe.debugHeader

Header for debugging

Kind: instance property of Strandpipe

Strandpipe~getPipeStream() ⇒ Pipe

Get current running Pipestream. Will throw an error if no Pipestream is running.

Kind: inner method of Strandpipe

Strandpipe~listen() ⇒ EventEmitter

Add a listener.

Kind: inner method of Strandpipe
Returns: EventEmitter - Listen to an event.

Strandpipe~sync(next) ⇒ *

Run a Task to circulate Asynchronous value into Synchronous value. Need a running Pipestream, and needs to be placed inside a Pipe. Only for .then()-able function. Use streamSync() for another type of callback.

Kind: inner method of Strandpipe
Returns: * - The result of running task

Param Type Description
next function A Function/Task that needs to be executed in order to get the Promised value

Strandpipe~streamSync(next) ⇒ *

If method .sync() failed, use .streamSync(). This method is specifically used for function that needs to handle error. They utilize function(err, value) instead of .then(). If error is called from callback, it will automatically thrown as RangeError

Kind: inner method of Strandpipe

Param Type Description
next function A Function/Task that needs to be executed in order to get the Promised value

Strandpipe~flow() ⇒ Array

Specialized method to runs an Array of Tasks. Returns Array of results. Only for .then()-able function.

Kind: inner method of Strandpipe

Type
Array.<function()>

Strandpipe~DesiredValue

Kind: inner typedef of Strandpipe

Threadify

Consist a bunch of stacked function to utilize Synchronous-ify API

Author: Riichi_Rusdiana#6815

Threadify.runner(next) ⇒ void

Start a runner.

Kind: static method of Threadify

Param Type Description
next PipedFunction The code that will be executed inside a runner.

Threadify.addListener(stream, next) ⇒ void

Create a listener session for a runner.

Kind: static method of Threadify

Param Type Description
stream Strandpipe You need to construct Strandpipe outside the Listener.
next function The code that will be executed inside a runner.

Threadify~sleep(ms) ⇒ void

Sleep for amount of time, before executing another process

Kind: inner method of Threadify

Param Type Description
ms long Sleep time in Millis

Threadify~PipedFunction : function

Kind: inner typedef of Threadify

Param Type Description
stream Strandpipe Contains an instance of Strandpipe. The object Pipe is available via stream.pipe, and current pipe via stream.current.

Pipe()

The base of Strandpipe, consist of method for running and yielding synchronous jobs. Instance of Fibers/Coroutines.

Kind: global function

Future()

The base of Future methods and stuff

Kind: global function

ErrorType

Kind: global typedef