Skip to main content
Module

x/effection/mod.ts

Structured concurrency and effects for JavaScript
Go to Latest
import * as effection from "https://deno.land/x/effection@3.0.0-alpha.13/mod.ts";

Variables

Consume an effection stream using a simple for-of loop.

Functions

Create an Operation that can be either resolved (or rejected) with a synchronous callback. This is the Effection equivalent of new Promise().

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.

Halt process execution immediately and initiate shutdown. If a message is provided, it will be logged to the console after shutdown:

Top-level entry point to programs written in Effection. That means that your program should only call main once, and everything the program does is handled from within main including an orderly shutdown. Unlike run, main automatically prints errors that occurred to the console.

An operation that runs another operation concurrently as a child.

Indefinitely pause execution of the current operation. It is typically used in conjunction with an action to mark the boundary between setup and teardown.

Interfaces

`Context`` defines a value which is in effect for a given scope which is an (action, resource, call, or spawn).

An Operation in Effection describes an abstract computation. An operation does not do anything on its own. Rather, it only describes the steps it will take when it runs.