CompletableFutureCpsMonad

cps.monads.CompletableFutureCpsMonad$package.CompletableFutureCpsMonad
object CompletableFutureCpsMonad extends CpsSchedulingMonad[[T <: <FromJavaObject>] =>> CompletableFuture[T]], CpsTryMonadInstanceContext[[T <: <FromJavaObject>] =>> CompletableFuture[T]]

Attributes

Source
CompletableFutureCpsMonad.scala
Graph
Supertypes
trait CpsTryMonadInstanceContext[[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 CpsTrySupport[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsThrowMonad[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsThrowSupport[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsMonad[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
class Object
trait Matchable
class Any
Show all
Self type

Members list

Type members

Inherited types

override type Context = CpsTryMonadInstanceContextBody[[T <: <FromJavaObject>] =>> CompletableFuture[T]]

Attributes

Inherited from:
CpsTryMonadInstanceContext
Source
CpsMonadContext.scala
type Spawned[A] = [T <: <FromJavaObject>] =>> CompletableFuture[T][A]

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

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

Attributes

Inherited from:
CpsSchedulingMonad
Source
CpsMonad.scala
type WF[X] = [T <: <FromJavaObject>] =>> CompletableFuture[T][X]

Attributes

Inherited from:
CpsMonad
Source
CpsMonad.scala

Value members

Concrete methods

def adoptCallbackStyle[A](source: ((Try[A]) => Unit) => Unit): CompletableFuture[A]

called by the source, which accept callback inside

called by the source, which accept callback inside

Attributes

Source
CompletableFutureCpsMonad.scala
def error[A](e: Throwable): CompletableFuture[A]

represent error e in monadic context.

represent error e in monadic context.

Attributes

Source
CompletableFutureCpsMonad.scala
def flatMap[A, B](fa: CompletableFuture[A])(f: A => CompletableFuture[B]): CompletableFuture[B]

bind combinator, which compose f over fa

bind combinator, which compose f over fa

Attributes

Source
CompletableFutureCpsMonad.scala
override def flatMapTry[A, B](fa: CompletableFuture[A])(f: (Try[A]) => CompletableFuture[B]): CompletableFuture[B]

flatMap over result of checked evaluation of A

flatMap over result of checked evaluation of A

Attributes

Definition Classes
Source
CompletableFutureCpsMonad.scala
def map[A, B](fa: CompletableFuture[A])(f: A => B): CompletableFuture[B]

map a function f over fa

map a function f over fa

Attributes

Source
CompletableFutureCpsMonad.scala
override def mapTry[A, B](fa: CompletableFuture[A])(f: (Try[A]) => B): CompletableFuture[B]

map over result of checked evaluation of A

map over result of checked evaluation of A

Attributes

Definition Classes
Source
CompletableFutureCpsMonad.scala
def pure[T](t: T): CompletableFuture[T]

Pure - wrap value t inside monad.

Pure - wrap value t inside monad.

Note, that pure use eager evaluation, which is different from Haskell.

Attributes

Source
CompletableFutureCpsMonad.scala
override def restore[A](fa: CompletableFuture[A])(fx: Throwable => CompletableFuture[A]): CompletableFuture[A]

restore fa, ie if fa sucessful - return fa, otherwise apply fx to received error.

restore fa, ie if fa sucessful - return fa, otherwise apply fx to received error.

Attributes

Definition Classes
Source
CompletableFutureCpsMonad.scala
def spawn[A](op: => CompletableFuture[A]): CompletableFuture[A]

schedule execution of op somewhere, immediatly. Note, that characteristics of scheduler can vary.

schedule execution of op somewhere, immediatly. Note, that characteristics of scheduler can vary.

Attributes

Source
CompletableFutureCpsMonad.scala
def tryCancel[A](op: CompletableFuture[A]): CompletableFuture[Unit]

Send cancel signal, which can be accepted or rejected by op flow.

Send cancel signal, which can be accepted or rejected by op flow.

Attributes

Source
CompletableFutureCpsMonad.scala

Inherited methods

override def apply[T](op: Context => CompletableFuture[T]): [T <: <FromJavaObject>] =>> CompletableFuture[T][T]

run op in the context environment.

run op in the context environment.

Attributes

Definition Classes
Inherited from:
CpsTryMonadInstanceContext
Source
CpsMonadContext.scala
def concurrently[A, B](fa: CompletableFuture[A], fb: CompletableFuture[B]): [T <: <FromJavaObject>] =>> CompletableFuture[T][Either[(Try[A], Spawned[B]), (Spawned[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.

Attributes

Inherited from:
CpsConcurrentMonad
Source
CpsMonad.scala
override def flatWrap[T](op: => CompletableFuture[T]): [T <: <FromJavaObject>] =>> CompletableFuture[T][T]

Wrap and flatten of monadic expression..

Wrap and flatten of monadic expression..

Attributes

Definition Classes
Inherited from:
CpsSchedulingMonad
Source
CpsMonad.scala
def flatten[T](ffa: CompletableFuture[CompletableFuture[T]]): [T <: <FromJavaObject>] =>> CompletableFuture[T][T]

Attributes

Inherited from:
CpsMonad
Source
CpsMonad.scala
def fromTry[A](r: Try[A]): [T <: <FromJavaObject>] =>> CompletableFuture[T][A]

transform r into pure value or error.

transform r into pure value or error.

Attributes

Inherited from:
CpsTryMonad
Source
CpsMonad.scala
def join[A](op: CompletableFuture[A]): [T <: <FromJavaObject>] =>> CompletableFuture[T][A]

join spawned immediate monad means to receive those spawing monad.

join spawned immediate monad means to receive those spawing monad.

Attributes

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

synonym for flatMapTry needed for processing awaits inside mapTry.

synonym for flatMapTry needed for processing awaits inside mapTry.

Attributes

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

spawn the process of spawning. Used to unify concurrent operation in lazy and eager monads.

spawn the process of spawning. Used to unify concurrent operation in lazy and eager monads.

Attributes

Inherited from:
CpsSchedulingMonad
Source
CpsMonad.scala
def spawnSync[A](op: => A): [T <: <FromJavaObject>] =>> CompletableFuture[T][A]

schedule execution of op somewhere, immediatly. Note, that characteristics of scheduler can vary. TODO: rename to spawn until we not stabilized

schedule execution of op somewhere, immediatly. Note, that characteristics of scheduler can vary. TODO: rename to spawn until we not stabilized

Attributes

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

Attributes

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

Attributes

Inherited from:
CpsTryMonad
Source
CpsMonad.scala
def tryPureAsync[A](a: () => CompletableFuture[A]): [T <: <FromJavaObject>] =>> CompletableFuture[T][A]

async shift of tryPure.

async shift of tryPure.

Attributes

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

ensure that action will run before getting value from fa

ensure that action will run before getting value from fa

Attributes

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

async shift of withAction.

async shift of withAction.

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

Attributes

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

return result of fa after completition of action.

return result of fa after completition of action.

Attributes

Inherited from:
CpsTryMonad
Source
CpsMonad.scala
def withAsyncErrorHandler[A](fa: => CompletableFuture[A])(f: Throwable => CompletableFuture[A]): [T <: <FromJavaObject>] =>> CompletableFuture[T][A]

Attributes

Inherited from:
CpsTrySupport
Source
CpsMonad.scala
def withAsyncFinalizer[A](fa: => CompletableFuture[A])(f: => CompletableFuture[Unit]): [T <: <FromJavaObject>] =>> CompletableFuture[T][A]

Attributes

Inherited from:
CpsTrySupport
Source
CpsMonad.scala
override def wrap[T](op: => T): [T <: <FromJavaObject>] =>> CompletableFuture[T][T]

spawnSync

spawnSync

Attributes

Definition Classes
Inherited from:
CpsSchedulingMonad
Source
CpsMonad.scala