Asynchronous operations have the async-awaitstd/async/internal/async-await: (E, V) -> V effect.
Usually there is only one handler for asynchronous operations at
the main function using the default handler (inserted
automatically if main has the async effect).
The cancelation effect which allows for cancelation of any
outstanding asynchronous (interleaved) operations in a cancelation scope (async-scopestd/async/internal/async-scope: V).
Effect to allow iocstd/core/ioc: E operations to execute in the scope of the handler.
Internal: perform an I/O operation in the outer async handler
Call the fun async-iocstd/async/internal/async-ioc: forall<a> (action : () -> ioc a) -> async-ioc a operation of the effect async-iocstd/async/internal/async-ioc: (E, V) -> V.
An abstract cancelation async-scope.
O(1). Are the scopes equal?
Is async-scopestd/async/internal/async-scope: -> async-cancel async-scope equal to, or a child async-scope of root?
Internal: The current cancelations scope.
Call the val async-scopestd/async/internal/async-scope: -> async-cancel async-scope operation of the effect async-cancelstd/async/internal/async-cancel: (E, V) -> V.
Internal: Cancel any outstanding async operations of a specific cancelation scope (and all its children)
Call the fun cancel-scopestd/async/internal/cancel-scope: (scope : async-scope) -> async-cancel () operation of the effect async-cancelstd/async/internal/async-cancel: (E, V) -> V.
Internal: Has the current scope ever been canceled?
Call the fun is-scope-canceledstd/async/internal/is-scope-canceled: (scope : async-scope) -> async-cancel bool operation of the effect async-cancelstd/async/internal/async-cancel: (E, V) -> V.
A scope is the chain starting with the current scope, including parent scopes up to the root scope-id.
An await result is either canceled, an exception, or a regular return value.
Internal: setup a primitive callback and await its completion. The setup is performed in the handler scope.
Call the ctl do-awaitstd/async/internal/do-await: forall<a> (setup : await-setup<a>, async-scope : async-scope, label : string) -> async-await await-result<a> operation of the effect async-awaitstd/async/internal/async-await: (E, V) -> V.
Automatically generated. Tests for the Cancelstd/async/internal/Cancel: forall<a> await-result<a> constructor of the await-resultstd/async/internal/await-result: V -> V type.
Automatically generated. Tests for the Exception constructor of the await-resultstd/async/internal/await-result: V -> V type.
Automatically generated. Tests for the Resultstd/async/internal/Result: forall<a> (value : a) -> await-result<a> constructor of the await-resultstd/async/internal/await-result: V -> V type.
A function that will setup a primitive await. It gets passed the current event loop
and a resumption function, and returns either an error or a dispose function.
The resumption gets the await-resultstd/async/internal/await-result: V -> V (cancel, exception, or regular result) and
whether this is the last time the resumption is called (isdone).
Function that disposes any resources for an await call (i.e. clearTimeout)
and should ensure that any primitive callback is no longer called.
Abstract type for an external event loop.
Internal: perform an I/O operation in the outer async handler in the next event loop tick
Call the fun async-schedule-iocstd/async/internal/async-schedule-ioc: (action : () -> ioc ()) -> async-ioc () operation of the effect async-iocstd/async/internal/async-ioc: (E, V) -> V.
After the setup is performed. cb is performed in the handler scope.
Call the fun no-awaitstd/async/internal/no-await: forall<a> (setup : await-setup<a>, async-scope : async-scope, label : string, cb : (await-result<a>) -> ioc ()) -> async-await () operation of the effect async-awaitstd/async/internal/async-await: (E, V) -> V.
Asynchronous internal primitives
This module defines the primitive asynchronous effects for asynchronous operations (
async-awaitstd/async/internal/async-await: (E, V) -> V) and cancelation (async-cancelstd/async/internal/async-cancel: (E, V) -> V). The operations of these effects break the abstraction and should only be used by library implementations.