Object/Trait

io.scalajs.npm.async

Async

Related Docs: trait Async | package async

Permalink

object Async extends Object with Async

Async is a utility module which provides straight-forward, powerful functions for working with asynchronous JavaScript. Although originally designed for use with Node.js and installable via npm install --save async, it can also be used directly in the browser.

Annotations
@native() @JSImport( "async" , JSImport.Namespace )
Version

2.0.1

See also

http://caolan.github.io/async/

Linear Supertypes
Async, Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Async
  2. Async
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def applyEach(functions: Array[Function], args: Any, args2: Any, args3: Any, args4: Any, args5: Any, args6: Any, callback: Function): Unit

    Permalink
    Definition Classes
    Async
  5. def applyEach(functions: Array[Function], args: Any, args2: Any, args3: Any, args4: Any, args5: Any, callback: Function): Unit

    Permalink
    Definition Classes
    Async
  6. def applyEach(functions: Array[Function], args: Any, args2: Any, args3: Any, args4: Any, callback: Function): Unit

    Permalink
    Definition Classes
    Async
  7. def applyEach(functions: Array[Function], args: Any, args2: Any, args3: Any, callback: Function): Unit

    Permalink
    Definition Classes
    Async
  8. def applyEach(functions: Array[Function], args: Any, args2: Any, callback: Function): Unit

    Permalink
    Definition Classes
    Async
  9. def applyEach(functions: Array[Function], args: Any, callback: Function): Unit

    Permalink

    Applies the provided arguments to each function in the array, calling callback after all functions have completed.

    Applies the provided arguments to each function in the array, calling callback after all functions have completed. If you only provide the first argument, then it will return a function which lets you pass in the arguments as if it were a single function call.

    functions

    A collection of asynchronous functions to all call with the same arguments

    args

    any number of separate arguments to pass to the function

    callback

    the final argument should be the callback, called when all functions have completed processing

    Definition Classes
    Async
  10. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def compose(functions: Function*): AsyncResultCallback

    Permalink

    Creates a function which is a composition of the passed asynchronous functions.

    Creates a function which is a composition of the passed asynchronous functions. Each function consumes the return value of the function that follows. Composing functions f(), g(), and h() would produce the result of f(g(h())), only this version uses callbacks to obtain the return values.

    functions

    the asynchronous functions to compose

    Definition Classes
    Async
    Example:
    1. compose(fn1, fn2...)

  13. def each(coll: Array[_ <: Any], iteratee: Function, callback: AsyncResultCallback = null): Unit

    Permalink

    Applies the function iteratee to each item in coll, in parallel.

    Applies the function iteratee to each item in coll, in parallel. The iteratee is called with an item from the list, and a callback for when it has finished. If the iteratee passes an error to its callback, the main callback (for the each function) is immediately called with the error.

    Note, that since this function applies iteratee to each item in parallel, there is no guarantee that the iteratee functions will complete in order.

    coll

    A collection to iterate over.

    iteratee

    A function to apply to each item in coll. The iteratee is passed a callback(err) which must be called once it has completed. If no error has occurred, the callback should be run without arguments or with an explicit null argument. The array index is not passed to the iteratee. If you need the index, use forEachOf.

    callback

    An optional callback which is called when all iteratee functions have finished, or an error occurs.

    Definition Classes
    Async
  14. def eachLimit(coll: Array[_ <: Any], limit: Int, iteratee: Function, callback: AsyncResultCallback = null): Unit

    Permalink

    Applies the function iteratee to each item in coll, in parallel.

    Applies the function iteratee to each item in coll, in parallel. The iteratee is called with an item from the list, and a callback for when it has finished. If the iteratee passes an error to its callback, the main callback (for the each function) is immediately called with the error.

    Note, that since this function applies iteratee to each item in parallel, there is no guarantee that the iteratee functions will complete in order.

    coll

    A collection to iterate over.

    limit

    the limit

    iteratee

    A function to apply to each item in coll. The iteratee is passed a callback(err) which must be called once it has completed. If no error has occurred, the callback should be run without arguments or with an explicit null argument. The array index is not passed to the iteratee. If you need the index, use forEachOf.

    callback

    Optional A callback which is called when all iteratee functions have finished, or an error occurs.

    Definition Classes
    Async
  15. def eachSeries(coll: Array[_ <: Any], iteratee: Function, callback: AsyncResultCallback = null): Unit

    Permalink

    Applies the function iteratee to each item in coll, in parallel.

    Applies the function iteratee to each item in coll, in parallel. The iteratee is called with an item from the list, and a callback for when it has finished. If the iteratee passes an error to its callback, the main callback (for the each function) is immediately called with the error.

    Note, that since this function applies iteratee to each item in parallel, there is no guarantee that the iteratee functions will complete in order.

    coll

    A collection to iterate over.

    iteratee

    A function to apply to each item in coll. The iteratee is passed a callback(err) which must be called once it has completed. If no error has occurred, the callback should be run without arguments or with an explicit null argument. The array index is not passed to the iteratee. If you need the index, use forEachOf.

    callback

    An optional callback which is called when all iteratee functions have finished, or an error occurs.

    Definition Classes
    Async
  16. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  18. def filter(coll: Array[_ <: Any], iteratee: Function, callback: AsyncResultCallback = null): Unit

    Permalink

    Returns a new array of all the values in coll which pass an async truth test.

    Returns a new array of all the values in coll which pass an async truth test. This operation is performed in parallel, but the results array will be in the same order as the original.

    coll

    A collection to iterate over.

    iteratee

    iteratee(item, callback) - A truth test to apply to each item in coll. The iteratee is passed a callback(err, truthValue) , which must be called with a boolean argument once it has completed. Callback arguments changed in 2.0

    callback

    callback(err, results) - Optional A callback which is called after all the iteratee functions have finished.

    Definition Classes
    Async
  19. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def forEachOf(coll: Any, iteratee: Function, callback: AsyncErrorCallback = null): Unit

    Permalink

    Like each, except that it passes the key (or index) as the second argument to the iteratee.

    Like each, except that it passes the key (or index) as the second argument to the iteratee.

    coll

    A collection to iterate over.

    iteratee

    iteratee(item, key, callback) - A function to apply to each item in coll. The key is the item's key, or index in the case of an array. The iteratee is passed a callback(err) which must be called once it has completed. If no error has occurred, the callback should be run without arguments or with an explicit null argument.

    callback

    callback(err) - An optional callback which is called when all iteratee functions have finished, or an error occurs.

    Definition Classes
    Async
    Example:
    1. forEachOf(coll, iteratee, [callback])

  21. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  22. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  23. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  25. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  26. def map(coll: Array[_ <: Any], iteratee: Function, callback: AsyncResultCallback): Unit

    Permalink

    Produces a new collection of values by mapping each value in coll through the iteratee function.

    Produces a new collection of values by mapping each value in coll through the iteratee function. The iteratee is called with an item from coll and a callback for when it has finished processing. Each of these callback takes 2 arguments: an error, and the transformed item from coll. If iteratee passes an error to its callback, the main callback (for the map function) is immediately called with the error.

    coll

    A collection to iterate over.

    iteratee

    iteratee(item, callback) - A function to apply to each item in coll. The iteratee is passed a callback(err, transformed) which must be called once it has completed with an error (which can be null) and a transformed item.

    callback

    callback(err, results) - Optional A callback which is called when all iteratee functions have finished, or an error occurs. Results is an array of the transformed items from the coll.

    Definition Classes
    Async
  27. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  28. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. def parallel(tasks: Array[Function], callback: AsyncResultCallback = null): Unit

    Permalink

    Run the tasks collection of functions in parallel, without waiting until the previous function has completed.

    Run the tasks collection of functions in parallel, without waiting until the previous function has completed. If any of the functions pass an error to its callback, the main callback is immediately called with the value of the error. Once the tasks have completed, the results are passed to the final callback as an array.

    tasks

    A collection containing functions to run. Each function is passed a callback(err, result) which it must call on completion with an error err (which can be null) and an optional result value.

    callback

    callback(err, results) - An optional callback to run once all the functions have completed successfully. This function gets a results array (or object) containing all the result arguments passed to the task callbacks.

    Definition Classes
    Async
  31. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  32. def queue[T](worker: Function, concurrency: Int = 1): QueueObject[T]

    Permalink

    Creates a queue object with the specified concurrency.

    Creates a queue object with the specified concurrency. Tasks added to the queue are processed in parallel (up to the concurrency limit). If all workers are in progress, the task is queued until one becomes available. Once a worker completes a task, that task's callback is called.

    worker

    An asynchronous function for processing a queued task, which must call its callback(err) argument when finished, with an optional error as an argument. If you want to handle errors from an individual task, pass a callback to q.push(). Invoked with (task, callback).

    concurrency

    An integer for determining how many worker functions should be run in parallel. If omitted, the concurrency defaults to 1. If the concurrency is 0, an error is thrown.

    returns

    A queue object to manage the tasks. Callbacks can attached as certain properties to listen for specific events during the lifecycle of the queue.

    Definition Classes
    Async
  33. def reject(coll: Any, iteratee: Function, callback: AsyncResultCallback = null): Unit

    Permalink

    The opposite of filter.

    The opposite of filter. Removes values that pass an async truth test.

    coll

    A collection to iterate over.

    iteratee

    iteratee(item, callback) - A truth test to apply to each item in coll. The iteratee is passed a callback(err, truthValue) , which must be called with a boolean argument once it has completed. Callback arguments changed in 2.0

    callback

    callback(err, results) - Optional A callback which is called after all the iteratee functions have finished.

    Definition Classes
    Async
    Example:
    1. reject(coll, iteratee, [callback])

  34. def seq(functions: Function): AsyncResultCallback

    Permalink

    Version of the compose function that is more natural to read.

    Version of the compose function that is more natural to read. Each function consumes the return value of the previous function. It is the equivalent of compose with the arguments reversed.

    Each function is executed with the this binding of the composed function.

    functions

    the asynchronous functions to compose

    Definition Classes
    Async
    Example:
    1. seq(fn1, fn2...)

  35. def series(tasks: Array[Function]): Unit

    Permalink
    Definition Classes
    Async
  36. def setImmediate(callback: Function, args: Any*): Unit

    Permalink

    Calls callback on a later loop around the event loop.

    Calls callback on a later loop around the event loop. In Node.js this just calls setImmediate. In the browser it will use setImmediate if available, otherwise setTimeout(callback, 0), which means other higher priority events may precede the execution of callback.

    This is used internally for browser-compatibility purposes.

    callback

    The function to call on a later loop around the event loop.

    args

    any number of additional arguments to pass to the callback on the next tick

    Definition Classes
    Async
  37. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  38. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  39. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  40. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  41. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. def waterfall(tasks: Array[_ <: Function], callback: AsyncResultCallback = null): Unit

    Permalink

    Runs the tasks array of functions in series, each passing their results to the next in the array.

    Runs the tasks array of functions in series, each passing their results to the next in the array. However, if any of the tasks pass an error to their own callback, the next function is not executed, and the main callback is immediately called with the error.

    tasks

    An array of functions to run, each function is passed a callback(err, result1, result2, ...) it must call on completion. The first argument is an error (which can be null) and any further arguments will be passed as arguments in order to the next task.

    callback

    An optional callback to run once all the functions have completed. This will be passed the results of the last task's callback (e.g. callback(err, [results])).

    Definition Classes
    Async

Inherited from Async

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped