FutureExecutor

libretto.scaletto.impl.futurebased.FutureExecutor
See theFutureExecutor companion object
class FutureExecutor(ec: ExecutionContext, scheduler: Scheduler, blockingExecutor: Executor) extends ScalettoExecutor

Executor of FreeScaletto based on Futures and Promises.

It is known to be flawed by design in that it might create long (potentially infinite) chains of Promises. This could be solved with a custom implementation of promises/futures that support unregistration of listeners.

On top of that, expect bugs, since the implementation is full of unsafe type casts, because Scala's (including Dotty's) type inference cannot cope with the kind of pattern matches found here.

Attributes

Companion:
object
Graph
Supertypes
trait Executor
class Object
trait Matchable
class Any

Members list

Concise view

Type members

Types

override type Bridge = BridgeImpl.type
override type Dsl = FreeScaletto.type
override type ExecutionParam[A] = ExecutionParam[A]

Type of parameters used to tweak execution.

Type of parameters used to tweak execution.

Attributes

A

returned to the caller when execution starts

Value members

Concrete methods

override def cancel(using pos: SourcePos)(execution: Execution): Async[Unit]

Attributes

Definition Classes
override def execute[A, B, P](prg: A -⚬ B, params: ExecutionParam[P]): (Executing[Bridge, A, B], P)

Attributes

Definition Classes

Watch for abrupt cancellation of the given Execution. If the execution completes normally, the returned Async may never complete.

Watch for abrupt cancellation of the given Execution. If the execution completes normally, the returned Async may never complete.

Attributes

Definition Classes

Inherited methods

final def execute[A, B](prg: A -⚬ B): Executing[Bridge, A, B]

Attributes

Inherited from:
Executor
override def narrow: Of[Dsl, Bridge]

Attributes

Definition Classes
Inherited from:
ScalettoExecutor

Concrete fields

override val bridge: Bridge
override val dsl: Dsl