api

async.ch

Declarations in async.ch

1 declarationscore

Declarations

Public only
core#
Publicnamespace
namespace core
The async/await runtime protocol (design Section 4.2/4.3).
async#
Publicnamespace
namespace async
Poll#
Publicvariant
variant Poll<T> { var Ready : Poll var Pending : Poll }
The output of polling a future.
WakerVTable#
Publicstruct
struct WakerVTable { var wake : func(*void) : void var clone : func(*void) : Waker var drop : func(*void) : void }
A type-erased wake callback table. `data` is the task handle.
Waker#
Publicstruct
struct Waker { var data : *void var vtbl : *WakerVTable }
A cloneable, type-erased wake callback. `data` points at the task.
wake#
Publicfunction
func wake(self : &Waker) : void
clone#
Publicfunction
func clone(self : &Waker) : Waker
delete#
Publicfunction
func delete(self : &Waker) : void
Context#
Publicstruct
struct Context { var waker : Waker }
Passed to every poll; carries the waker for the current task.
delete#
function
func delete(self : *Context) : void
Passed to every poll; carries the waker for the current task.
Future#
Publicinterface
interface Future<T>
The contract a hand-authored future implements. An `async func` does NOT
poll#
Publicfunction
func poll(self : &Future, cx : *Context) : Poll<T>
FutureTable#
Publicstruct
struct FutureTable<T> { var poll : func(*void, *Context) : Poll<T> var drop : func(*void) : void }
The vtable behind every runtime future handle.
FutureHandle#
Publicstruct
struct FutureHandle<T> { var frame : *void var vtbl : *FutureTable<T> }
The concrete, move-only representation of every future. `@delete` is what
delete#
Publicfunction
func delete(self : &FutureHandle) : void
Unit#
Publicstruct
struct Unit
A zero-sized "no value" result.
make#
functionConstructor
func make() : Unit
A zero-sized "no value" result.
chemical_async_frame_alloc#
Publicfunction
func chemical_async_frame_alloc(size : u64, align : u64) : *void
Frame allocation hooks, provided by the runtime library (`lang/libs/async`).
chemical_async_frame_free#
Publicfunction
func chemical_async_frame_free(ptr : *void, size : u64, align : u64) : void