FutureAsyncMonadAPI

class FutureAsyncMonadAPI(using x$1: ExecutionContext) extends CpsSchedulingMonad[Future] with CpsContextMonad[Future, FutureContext]

Default CpsMonad implementation for Future

trait CpsSchedulingMonad[Future]
trait CpsConcurrentMonad[Future]
trait CpsAsyncMonad[Future]
trait CpsTryMonad[Future]
trait CpsMonad[Future]
trait CpsAwaitable[Future]
class Object
trait Matchable
class Any

Type members

Types

type F[+T] = Future[T]
override type WF[T] = Future[T]

Inherited types

override type Context = Ctx
Inherited from:
CpsContextMonad
type Spawned[A] = F[A]

In eager monad, spawned process can be represented by F[_]

In eager monad, spawned process can be represented by F[_]

Inherited from:
CpsSchedulingMonad

Value members

Concrete methods

def adoptCallbackStyle[A](source: (Try[A] => Unit) => Unit): Future[A]
override def applyContext[A](f: FutureContext => Future[A]): Future[A]
Definition Classes
override def concurrently[A, B](fa: Future[A], fb: Future[B]): Future[Either[(Try[A], Future[B]), (Future[A], Try[B])]]

join two computations in such way, that they will execute concurrently. Since Future computation is already spawned, we can not spawn waiting for results here

join two computations in such way, that they will execute concurrently. Since Future computation is already spawned, we can not spawn waiting for results here

Definition Classes
def error[A](e: Throwable): Future[A]
def executionContext: ExecutionContext
def flatMap[A, B](fa: Future[A])(f: A => Future[B]): Future[B]
def flatMapTry[A, B](fa: Future[A])(f: Try[A] => Future[B]): Future[B]
def map[A, B](fa: Future[A])(f: A => B): Future[B]
override def mapTry[A, B](fa: Future[A])(f: Try[A] => B): Future[B]
Definition Classes
def pure[T](t: T): Future[T]
override def restore[A](fa: Future[A])(fx: Throwable => Future[A]): Future[A]
Definition Classes
def spawn[A](op: => Future[A]): Future[A]
def tryCancel[A](op: Future[A]): Future[Unit]

returns failed Future, because cancellation is not supported.

returns failed Future, because cancellation is not supported.

Inherited methods

def apply[T](op: Context => Future[T]): Future[T]

delegated to applyContext

delegated to applyContext

See also:

applyContext

Inherited from:
CpsContextMonad
def fromTry[A](r: Try[A]): Future[A]

transform r into pure value or error.

transform r into pure value or error.

Inherited from:
CpsTryMonad
def join[A](op: Future[A]): Future[A]

join spawned immediate monad means to receive those spawing monad.

join spawned immediate monad means to receive those spawing monad.

Inherited from:
CpsSchedulingMonad
def mapTryAsync[A, B](fa: Future[A])(f: Try[A] => Future[B]): Future[B]

synonym for flatMapTry needed for processing awaits inside mapTry.

synonym for flatMapTry needed for processing awaits inside mapTry.

Inherited from:
CpsTryMonad
def spawnEffect[A](op: => Future[A]): Future[Future[A]]

representation of spawnEffect as immediate operation.

representation of spawnEffect as immediate operation.

Inherited from:
CpsSchedulingMonad
def tryImpure[A](a: => Future[A]): Future[A]

try to evaluate async operation and wrap successful or failed result into F.

try to evaluate async operation and wrap successful or failed result into F.

Inherited from:
CpsTryMonad
def tryPure[A](a: => A): Future[A]

try to evaluate synchonious operation and wrap successful or failed result into F.

try to evaluate synchonious operation and wrap successful or failed result into F.

Inherited from:
CpsTryMonad
def tryPureAsync[A](a: () => Future[A]): Future[A]

async shift of tryPure.

async shift of tryPure.

Inherited from:
CpsTryMonad
def withAction[A](fa: Future[A])(action: => Unit): Future[A]

ensure that action will run before getting value from fa

ensure that action will run before getting value from fa

Inherited from:
CpsTryMonad
def withActionAsync[A](fa: Future[A])(action: () => Future[Unit]): Future[A]

async shift of withAction.

async shift of withAction.

This method is substituted instead withAction, when we use await inside withAction argument.

Inherited from:
CpsTryMonad
def withAsyncAction[A](fa: Future[A])(action: => Future[Unit]): Future[A]

return result of fa after completition of action.

return result of fa after completition of action.

Inherited from:
CpsTryMonad