object FutureUtil
- Alphabetic
- By Inheritance
- FutureUtil
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def batchAndParallelExecute[T, U](elements: Vector[T], f: (Vector[T]) => Future[U])(implicit ec: ExecutionContext): Future[Vector[U]]
Same as batchAndParallelExecute(), but computes the batchSize based on the number of available processors on your machine
- def batchAndParallelExecute[T, U](elements: Vector[T], f: (Vector[T]) => Future[U], batchSize: Int)(implicit ec: ExecutionContext): Future[Vector[U]]
Batches the elements by batchSize and then calls f on them in parallel This is the parallel version of batchAndSyncExecute()
- def batchAndSyncExecute[T, U](elements: Vector[T], f: (Vector[T]) => Future[Vector[U]], batchSize: Int)(implicit ec: ExecutionContext): Future[Vector[U]]
Batches the elements by batchSize, executes f, and then aggregates all of the results into a vector and returns it.
Batches the elements by batchSize, executes f, and then aggregates all of the results into a vector and returns it. This is is the synchronous version of batchAndParallelExecute
- def batchExecute[T, U](elements: Vector[T], f: (Vector[T]) => Future[U], init: U, batchSize: Int)(implicit ec: ExecutionContext): Future[U]
Takes elements, groups them into batches of 'batchSize' and then calls f on them.
Takes elements, groups them into batches of 'batchSize' and then calls f on them. The next batch does not start executing until the first batch is finished. This does not aggregate result over batches, rather just returns the result of the last batch
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def collect[T](items: Iterable[Future[T]])(implicit ec: ExecutionContext): Future[Vector[T]]
Executes a series of futures sequentially.
Executes a series of futures sequentially. It's similar to FutureUtil.sequentially(), but it accepts a collection of futures and executes them one by one.
- items
The collection of futures
- returns
The processed elements
- def emptyVec[T]: Future[Vector[T]]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def foldLeftAsync[T, U](init: T, items: Seq[U])(fun: (T, U) => Future[T])(implicit ec: ExecutionContext): Future[T]
Folds over the given elements sequentially in a non-blocking async way
Folds over the given elements sequentially in a non-blocking async way
- init
the initialized value for the accumulator
- items
the items we are folding over
- fun
the function we are applying to every element that returns a future
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getParallelism: Int
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def makeAsync[T](func: () => T)(implicit ec: ExecutionContext): Future[T]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def none[T]: Future[Option[T]]
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def sequentially[T, U](items: Iterable[T])(fun: (T) => Future[U])(implicit ec: ExecutionContext): Future[Vector[U]]
Executes a series of futures sequentially
Executes a series of futures sequentially
- items
The elements we want to transform into futures
- fun
A function that transforms each element into a future
- returns
The processed elements
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- val unit: Future[Unit]
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()