api/classes/fibercontext
Globals / FiberContext
Class: FiberContext<A, E>
FiberContext actually evaluates the QIO expression. Its creation is effectful. As soon as its created it starts to evaluate the QIO expression. It provides public APIs to Fiber to consume.
Type parameters
Name |
---|
A |
E |
Hierarchy
Fiber<A, E>
↳ FiberContext
Implements
- ICancellable
Index
Properties
Accessors
Methods
Properties
id
• Readonly
id: number = FIBER_ID.create()
Defined in packages/core/lib/internals/Fiber.ts:71
runtime
• Readonly
runtime: FiberRuntime
Defined in packages/core/lib/internals/Fiber.ts:112
Accessors
abort
• get abort(): QIO<void>
Defined in packages/core/lib/internals/Fiber.ts:119
Returns: QIO<void>
await
• get await(): QIO<Exit<A, E>>
Defined in packages/core/lib/internals/Fiber.ts:125
Aborting the IO produced by await should abort the complete IO.
join
• get join(): QIO<A, E>
Defined in packages/core/lib/internals/Fiber.ts:73
Returns: QIO<A, E>
Methods
cancel
▸ cancel(): void
Defined in packages/core/lib/internals/Fiber.ts:134
Returns: void
unsafeObserve
▸ unsafeObserve(cb
: CBExit<A, E>): ICancellable
Defined in packages/core/lib/internals/Fiber.ts:147
The ICancellable
returned when called will only remove the passed on callback.
It will never cancel the complete Fiber.
To cancel the Fiber one must call the FiberContext.cancel method.
Parameters:
Name | Type |
---|---|
cb | CBExit<A, E> |
Returns: ICancellable
unsafeExecuteWith
▸ Static
unsafeExecuteWith<A, E>(io
: QIO<A, E>, runtime
: FiberRuntime, cb?
: CBExit<A, E>): FiberContext<A, E>
Overrides Fiber.unsafeExecuteWith
Defined in packages/core/lib/internals/Fiber.ts:87
Evaluates an IO using the provided scheduler
Type parameters:
Name |
---|
A |
E |
Parameters:
Name | Type |
---|---|
io | QIO<A, E> |
runtime | FiberRuntime |
cb? | CBExit<A, E> |
Returns: FiberContext<A, E>