AsyncEffectSystem

automorph.spi.AsyncEffectSystem
See theAsyncEffectSystem companion object
trait AsyncEffectSystem[Effect[_]] extends EffectSystem[Effect]

Asynchronous computational effect system plugin.

The underlying runtime must support monadic composition of effectful values and creation of externally completable effects.

Type parameters

Effect

effect type (similar to IO Monad in Haskell)

Attributes

Companion
object
Graph
Supertypes
trait EffectSystem[Effect]
class Object
trait Matchable
class Any
Known subtypes
class FutureSystem
class ZioSystem[Environment]

Members list

Value members

Abstract methods

def completable[T]: Effect[Completable[Effect, T]]

Creates an externally completable effect.

Creates an externally completable effect.

Type parameters

T

effectful value type

Attributes

Returns

completable effect

Inherited methods

def either[T](effect: => Effect[T]): Effect[Either[Throwable, T]]

Creates a new effect by lifting an effect's errors into a value.

Creates a new effect by lifting an effect's errors into a value.

The resulting effect cannot fail.

Type parameters

T

effectful value type

Value parameters

effect

effectful value

Attributes

Returns

effectful error or the original value

Inherited from:
EffectSystem
def evaluate[T](value: => T): Effect[T]

Lifts a potentially blocking and side-effecting value into a new effect of specified type.

Lifts a potentially blocking and side-effecting value into a new effect of specified type.

Exceptions thrown while computing the value are translated into a failed effect.

Type parameters

T

effectful value type

Value parameters

value

side-effecting value

Attributes

Returns

effect containing the value

Inherited from:
EffectSystem
def failed[T](exception: Throwable): Effect[T]

Lifts a exception into a failed effect of specified type.

Lifts a exception into a failed effect of specified type.

Type parameters

T

effectful value type

Value parameters

exception

exception

Attributes

Returns

effect containing the exception

Inherited from:
EffectSystem
def flatMap[T, R](effect: Effect[T])(function: T => Effect[R]): Effect[R]

Creates a new effect by applying an effectful function to an effect's value.

Creates a new effect by applying an effectful function to an effect's value.

Type parameters

R

effectful function result type

T

effectful value type

Value parameters

effect

effectful value

function

effectful function applied to the specified effect's value

Attributes

Returns

effect containing the transformed value

Inherited from:
EffectSystem
def map[T, R](effect: Effect[T])(function: T => R): Effect[R]

Creates a new effect by applying a function to an effect's value.

Creates a new effect by applying a function to an effect's value.

Type parameters

R

function result type

T

effectful value type

Value parameters

effect

effectful value

function

function applied to the specified effect's value

Attributes

Returns

transformed effectful value

Inherited from:
EffectSystem
def runAsync[T](effect: Effect[T]): Unit

Executes an effect asynchronously without blocking and discard the result.

Executes an effect asynchronously without blocking and discard the result.

Type parameters

T

effectful value type

Value parameters

effect

effectful value

Attributes

Returns

nothing

Inherited from:
EffectSystem
def successful[T](value: T): Effect[T]

Lifts a value without blocking or side-effects into a successfully completed effect of specified type.

Lifts a value without blocking or side-effects into a successfully completed effect of specified type.

Type parameters

T

effectful value type

Value parameters

value

value

Attributes

Returns

effect containing the value

Inherited from:
EffectSystem