CompletableFutureCpsMonad

object CompletableFutureCpsMonad extends CpsSchedulingMonad[[T <: <FromJavaObject>] =>> CompletableFuture[T]] with CpsMonadInstanceContext[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsMonadInstanceContext[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsMonadContext[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsSchedulingMonad[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsConcurrentMonad[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsAsyncMonad[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsTryMonad[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsMonad[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsAwaitable[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
class Object
trait Matchable
class Any

Type members

Inherited types

type Monad[X] = F[X]
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
Source:
CpsMonad.scala
type WF[X] = F[X]
Inherited from:
CpsMonad
Source:
CpsMonad.scala

Value members

Concrete methods

def adoptCallbackStyle[A](source: Try[A] => Unit => Unit): CompletableFuture[A]
def error[A](e: Throwable): CompletableFuture[A]
def flatMap[A, B](fa: CompletableFuture[A])(f: A => CompletableFuture[B]): CompletableFuture[B]
override def flatMapTry[A, B](fa: CompletableFuture[A])(f: Try[A] => CompletableFuture[B]): CompletableFuture[B]
def map[A, B](fa: CompletableFuture[A])(f: A => B): CompletableFuture[B]
override def mapTry[A, B](fa: CompletableFuture[A])(f: Try[A] => B): CompletableFuture[B]
def pure[T](t: T): CompletableFuture[T]
override def restore[A](fa: CompletableFuture[A])(fx: Throwable => CompletableFuture[A]): CompletableFuture[A]
def spawn[A](op: => CompletableFuture[A]): CompletableFuture[A]
def tryCancel[A](op: CompletableFuture[A]): CompletableFuture[Unit]

Inherited methods

def adoptAwait[A](fa: CompletableFuture[A]): CompletableFuture[A]

If is it statically known, that monad is evaluated in this context, then this call is completely eliminated by dotty-cps-async macro

If is it statically known, that monad is evaluated in this context, then this call is completely eliminated by dotty-cps-async macro

Returns:

fa

Inherited from:
CpsMonadInstanceContext
Source:
CpsMonadContext.scala
def apply[T](op: Context => CompletableFuture[T]): CompletableFuture[T]

run with this instance

run with this instance

Inherited from:
CpsMonadInstanceContext
Source:
CpsMonadContext.scala
def concurrently[A, B](fa: CompletableFuture[A], fb: CompletableFuture[B]): CompletableFuture[Either[(Try[A], CompletableFuture[B]), (CompletableFuture[A], Try[B])]]

join two computations in such way, that they will execute concurrently.

join two computations in such way, that they will execute concurrently.

Inherited from:
CpsConcurrentMonad
Source:
CpsMonad.scala
def fromTry[A](r: Try[A]): CompletableFuture[A]

transform r into pure value or error.

transform r into pure value or error.

Inherited from:
CpsTryMonad
Source:
CpsMonad.scala
def join[A](op: CompletableFuture[A]): CompletableFuture[A]

join spawned immediate monad means to receive those spawing monad.

join spawned immediate monad means to receive those spawing monad.

Inherited from:
CpsSchedulingMonad
Source:
CpsMonad.scala
def mapTryAsync[A, B](fa: CompletableFuture[A])(f: Try[A] => CompletableFuture[B]): CompletableFuture[B]

synonym for flatMapTry needed for processing awaits inside mapTry.

synonym for flatMapTry needed for processing awaits inside mapTry.

Inherited from:
CpsTryMonad
Source:
CpsMonad.scala
def spawnEffect[A](op: => CompletableFuture[A]): CompletableFuture[CompletableFuture[A]]

representation of spawnEffect as immediate operation.

representation of spawnEffect as immediate operation.

Inherited from:
CpsSchedulingMonad
Source:
CpsMonad.scala
def tryImpure[A](a: => CompletableFuture[A]): CompletableFuture[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
Source:
CpsMonad.scala
def tryPure[A](a: => A): CompletableFuture[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
Source:
CpsMonad.scala
def tryPureAsync[A](a: () => CompletableFuture[A]): CompletableFuture[A]

async shift of tryPure.

async shift of tryPure.

Inherited from:
CpsTryMonad
Source:
CpsMonad.scala
def withAction[A](fa: CompletableFuture[A])(action: => Unit): CompletableFuture[A]

ensure that action will run before getting value from fa

ensure that action will run before getting value from fa

Inherited from:
CpsTryMonad
Source:
CpsMonad.scala
def withActionAsync[A](fa: CompletableFuture[A])(action: () => CompletableFuture[Unit]): CompletableFuture[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
Source:
CpsMonad.scala
def withAsyncAction[A](fa: CompletableFuture[A])(action: => CompletableFuture[Unit]): CompletableFuture[A]

return result of fa after completition of action.

return result of fa after completition of action.

Inherited from:
CpsTryMonad
Source:
CpsMonad.scala