import public IO.Async.Core
import public Data.Linear.Ref1record FbrState : Type -> TypeInternal state of a running fiber.
FST : FiberImpl resErrs resType -> Nat -> Async e curErrs curType -> Stack e curErrs resErrs curType resType -> FbrState e.comp : ({rec:0} : FbrState e) -> Async e (curErrs {rec:0}) (curType {rec:0})0 .curErrs : FbrState e -> List Type0 .curType : FbrState e -> Type.fiber : ({rec:0} : FbrState e) -> FiberImpl (resErrs {rec:0}) (resType {rec:0}).mask : FbrState e -> Nat0 .resErrs : FbrState e -> List Type0 .resType : FbrState e -> Type.stack : ({rec:0} : FbrState e) -> Stack e (curErrs {rec:0}) (resErrs {rec:0}) (curType {rec:0}) (resType {rec:0})data RunRes : Type -> TypeResult of (partially) evaluate a fiber.
Done : RunRes eThe fiber has terminated with an `Outcome`, or we arrived at
an asynchronous boundary (`Asnc` data constructor) and the
fiber should be parked until a result is ready.
Cont : FbrState e -> RunRes eEvaluation of the fiber is not yet finished, but should be
rescheduled by moving the fiber at the end of the event loop's
work queue. This happens a) after a certain number of evaluation
steps, or b) when `cede` is encountered.
interface EventLoop : Type -> TypeA context for submitting and running work packages asynchronously.
The basic functionality of an event loop is to allow us to spawn
new work packages, all of which will then be run concurrently (but not
necessarily in parallel), and to `cede` a running computation, so that
it will be processed later while allowing other work packages to be
processed first.
In addition, an event loop can support arbitrary additional effects, for
instance, the ability to setup timers, signal handlers, and asynchronous
`IO` actions. These additional capabilities are represented by type
parameter `e`, representing the event loop currently processing a work
package.
spawn : e -> FbrState e -> IO1 ()Submits a fiber to be run by event loop `el`
limit : NatNumber of evaluation steps before a fiber should be rescheduled.
spawn : EventLoop e => e -> FbrState e -> IO1 ()Submits a fiber to be run by event loop `el`
limit : EventLoop e => NatNumber of evaluation steps before a fiber should be rescheduled.
runFbr : EventLoop e => e -> FbrState e -> IO1 (RunRes e)runAsyncWith : EventLoop e => e -> Async e es a -> (Outcome es a -> IO ()) -> IO ()runAsync : EventLoop e => e -> Async e es a -> IO ()