implicit final class AsyncExtensions extends AnyVal
Async Extensions
- Alphabetic
- By Inheritance
- AsyncExtensions
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val async: Async
-
def
eachFuture[A <: Any](coll: Array[A])(iteratee: (A, AsyncErrorCallback) ⇒ Any): Promise[A]
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.
- Annotations
- @inline()
-
def
eachLimitFuture[A <: Any](coll: Array[A], limit: Int)(iteratee: (A, AsyncErrorCallback) ⇒ Any): Promise[A]
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.
- Annotations
- @inline()
-
def
eachSeriesFuture[A <: Any](coll: Array[A])(iteratee: (A, AsyncErrorCallback) ⇒ Any): Promise[A]
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.
- Annotations
- @inline()
-
def
filterFuture[A <: Any](coll: Array[A])(iteratee: (A, AsyncErrorCallback) ⇒ Boolean): Promise[Array[A]]
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
- Annotations
- @inline()
-
def
forEachOfFuture[A](coll: Dictionary[A])(iteratee: (A, String, AsyncErrorCallback) ⇒ Any): Promise[Unit]
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
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.
- Annotations
- @inline()
-
def
forEachOfFuture[A](coll: Array[A])(iteratee: (A, Int, AsyncErrorCallback) ⇒ Any): Promise[Unit]
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.
- Annotations
- @inline()
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
parallelFuture[A <: Any](tasks: Array[Function]): Promise[A]
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.
- Annotations
- @inline()
-
def
rejectFuture[A <: Any](coll: Dictionary[A])(iteratee: (A, String) ⇒ Any): Promise[A]
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
- Annotations
- @inline()
-
def
rejectFuture[A <: Any](coll: Array[A])(iteratee: (A, Int) ⇒ Any): Promise[A]
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
- Annotations
- @inline()
-
def
toString(): String
- Definition Classes
- Any
-
def
waterfallFuture[A](tasks: Array[_ <: Function]): Promise[A]
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.
- Annotations
- @inline()