extensions

de.rmgk.delay$.extensions$
object extensions

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Extensions

Extensions

extension [Ctx, A](async: Async[Ctx, A])
inline def after(inline body: Ctx ?=> Either[Throwable, A] => Unit): Async[Ctx, A]

Runs body after the asynchronous computation is finished. Useful for running cleanup handlers.

Runs body after the asynchronous computation is finished. Useful for running cleanup handlers.

Attributes

inline def flatMap[B](inline f: A => Async[Ctx, B]): Async[Ctx, B]
inline def map[B](inline f: A => B): Async[Ctx, B]
inline def run(inline cb: Callback[A])(using inline ctx: Ctx): Unit

Start the underlying computation and pass the result to cb.

Start the underlying computation and pass the result to cb.

Attributes

inline def runToAsync(using inline ctx: Ctx): Async[Ctx, A]

Start the underlying computation immediately. The result is cached and can be accessed as Async

Start the underlying computation immediately. The result is cached and can be accessed as Async

Attributes

inline def runToFuture(using inline ctx: Ctx): Future[A]

Start the underlying computation immediately. Return a Future of the result.

Start the underlying computation immediately. Return a Future of the result.

Attributes

extension [Ctx, T](cs: CompletionStage[T])
inline def toAsync: Async[Ctx, T]
extension [A](fut: Future[A])
inline def toAsync(using inline ec: ExecutionContext): Async[Any, A]
extension [Ctx, A](sync: Sync[Ctx, A])
inline def flatMap[B](inline f: A => Sync[Ctx, B]): Sync[Ctx, B]
inline def map[B](inline f: A => B): Sync[Ctx, B]
inline def run(using inline ctx: Ctx): A

Executes the Sync given a Ctx.

Executes the Sync given a Ctx.

Attributes