A trait for capturing all failures thrown during an asynchronous parallel task.
A trait for capturing all failures thrown during an asynchronous parallel task. The first failure is immediately available and all others can be retrieved by waiting on a future.
A trait for a future whose execution does not begin until some condition occurs.
A trait for a future whose execution does not begin until some condition occurs. DeferredFuture completes once the start condition occurs and the deferred future completes.
A trait for a future that will be started after a delay
A trait for a task that after the initial delay expires, is repeatedly started with a specified period in the background.
A trait for a task that after the initial delay expires, is repeatedly started with a specified period in the background. This will continue until the task is cancelled or a failure occurs.
A trait for scheduling delayed or periodic tasks
The global base asynchronous config builder configured with one worker (serial) operation with all options disabled by default
s_mach.concurrent is an open-source Scala library that provides asynchronous serial and parallel execution flow control primitives for working with asynchronous tasks. An asynchronous task consists of two or more calls to function(s) that return a future result
A ⇒ Future[B]
instead of the resultA ⇒ B
.-
Adds concurrent flow control primitives
async
andasync.par
for performing fixed size heterogeneous (tuple) and variable size homogeneous (collection) asynchronous tasks. These primitives:-
Allow enabling optional progress reporting, failure retry and/or throttle control for asynchronous tasks
-
Ensure proper sequencing of returned futures, e.g. given
f: Int ⇒ Future[String]
:-
List(1,2,3).async.map(f)
returnsFuture[List[String]]
-
async.par.run(f(1),f(2),f(3))
returnsFuture[(String,String,String)]
-
Ensure fail-immediate sequencing of future results (see the Under the hood: Merge section for details)
-
Ensure all exceptions generated during asynchronous task processing can be retrieved (
Future.sequence
returns only the first)-
collection.async
andcollection.async.par
support collection operations such asmap
,flatMap
andforeach
on asynchronous functions, i.e.A ⇒ Future[B]
-
async.par.run(future1, future2, …)
supports running fixed size heterogeneous asynchronous task (of up to 22 futures) in parallel-
Adds
ScheduledExecutionContext
, a Scala interface wrapper forjava.util.concurrent.ScheduledExecutorService
that provides for scheduling delayed and periodic tasks-
Adds non-blocking concurrent control primitives such as
Barrier
,Latch
,Lock
andSemaphore
-
Provides convenience methods for writing more readable, concise and DRY concurrent code such as
Future.get
,Future.toTry
andFuture.fold