import * as effection from "https://deno.land/x/effection@4.0.0-alpha.1/lib/mod.ts";
Functions
f all | Block and wait for all of the given operations to complete. Returns an array of values that the given operations evaluated to. This has the same purpose as Promise.all. |
f call | Pause the current operation, async function, plain function, or operation function. The calling operation will be resumed (or errored) once call is completed. |
Creates a new queue. Queues are unlimited in size and sending a message to a queue is always synchronous. | |
Create a new Signal | |
f each | Consume an effection stream using a simple for-of loop. |
Run the given function or operation when the current operation
shuts down. This is equivalent to running the function or operation
in a | |
f exit | Halt process execution immediately and initiate shutdown. If a message is provided, it will be logged to the console after shutdown: |
f lift | Convert a simple function into an Operation |
f main | Top-level entry point to programs written in Effection. That means that your
program should only call |
f on | Create a Stream of events from any EventTarget. |
f once | Create an Operation that yields the next event to be emitted by an EventTarget. |
f race | Race the given operations against each other and return the value of whichever operation returns first. This has the same purpose as Promise.race. |
f run | Execute an operation. |
Sleep for the given amount of milliseconds. | |
Convert any | |
Convert any | |
Create an
| |
Interfaces
A uniform integration type representing anything that can be evaluated as a the parameter to call. | |
A broadcast channel that multiple consumers can subscribe to the via the same Stream, and messages sent to the channel are received by all consumers. The channel is not buffered, so if there are no consumers, the message is dropped. | |
| |
A value that is both an Operation and | |
An | |
A FIFO queue which can be used to implement the Subscription
interface directly. Most of the time, you will use either a Signal
or a Channel as the mechanism, but | |
A programatic API to interact with an Effection scope from outside of an Operation. | |
Convert plain JavaScript function calls into a Stream that can be consumed within an operation. If no operation is subscribed to a signal's stream, then sending messages to it is a no-op. | |
The Effection equivalent of an | |
I Task | A handle to a concurrently running operation that lets you either use the result of that operation, or shut it down. |
Type Aliases
The Effection equivalent of an | |
Unwrap the type of an |