This document describes the current and planned modules in brass-runtime, how they relate to each other, and how users are expected to navigate them.
The structure intentionally mirrors the mental model of ZIO:
- a small, principled core
- optional, layered modules
- everything expressed in terms of typed effects and structured concurrency
These modules form the runtime kernel. Everything else builds on top of them.
Status: ✅ stable
Responsible for executing effects.
Contents:
Scheduler— cooperative, deterministic task scheduler- task queue, microtask flushing
- fairness and explicit async boundaries
You almost never interact with this directly as a user.
Status: ✅ stable
The heart of the system.
Key types:
Effect<R, E, A>Async<R, E, A>Exit<E, A>
Capabilities:
- sync + async algebra (no Promises in semantics)
map,flatMap,fold, etc.- explicit async registration via callbacks
This is the semantic core of brass.
Status: ✅ stable
Lightweight fibers with structured lifecycle.
Features:
Fiber<E, A>abstraction- cooperative interruption
join,interrupt- LIFO finalizers
Fibers are always run under a Scope.
Status: ✅ stable
Structured concurrency and resource safety.
Features:
- parent / child scopes
- deterministic cleanup
addFinalizer,close- used by fibers, streams, HTTP, resources
Scopes ensure:
no leaks, no zombies, no forgotten cleanup
Status: ✅ stable
Resource-safe acquisition.
API:
acquireReleasefromResource
Ties resource lifetimes to scopes.
Status: ✅ stable
High-level structured concurrency.
Includes:
racezipParcollectAllParfork
Semantics:
- loser fibers are interrupted
- errors propagate deterministically
- scopes are respected
Status: 🚧 active
Pull-based, resource-safe streams.
Key ideas:
Pull<R, E, A>ZStream<R, E, A>- explicit backpressure
- scope-aware
Includes:
- constructors (
fromArray,fromPull,empty) - transformations (
map,filter) - execution (
runCollect,collectStream)
Status: 🚧 active
Stream buffering with backpressure.
Features:
- bounded buffers
- backpressure vs dropping modes
- deterministic cleanup
This is the foundation for:
- pipelines
- async boundaries in streams
- future hubs
Status: ⏳ planned
pipeline— ZPipeline-style transformationssink— consumers / reducershub— broadcast / pub-sub streamschannel— low-level streaming algebra
Status: ✅ usable / evolving
ZIO-HTTP–inspired client built on brass runtime.
Layers:
- wire layer:
HttpClient = Request => Async<_, HttpError, HttpWireResponse> - middleware: request/response transforms
- DX layer: ergonomic helpers (
getJson,postJson, etc.)
Key concepts:
- fully lazy
- cancelable via fibers
- no Promises in core semantics
- middleware-style composition (
withMeta, logging, retries, auth)
Submodules:
client.ts— low-level HTTP executionhttpClient.ts— DX + helperswithMeta— response enrichment middleware
Example usage:
const http = httpClientBuilder({ baseUrl }).withMeta();
const post = await toPromise(http.getJson<Post>("/posts/1"), {});Status: ✅ stable
Interop with Promise-based APIs.
Includes:
toPromise— await effects externallyfromPromiseAbortabletryPromiseAbortable
Important:
Promises are interop only, never a runtime primitive.
Status: ✅ maintained
Executable documentation.
Covers:
- fibers & interruption
- scopes & finalizers
- abortable promises
- streams + buffering
- HTTP usage
If you’re new: 👉 start here.
Understand the runtime
asyncEffectschedulerfiberscope
Use effects
map,flatMap,foldtoPromise(interop only)
Do concurrency
racezipParfork
Work with streams
streambuffer
Call HTTP
http/clienthttp/httpClient- middleware like
withMeta
- Explicit > implicit
- Structured > ad-hoc
- Lazy by default
- Cancellation is cooperative and visible
- No hidden async semantics
brass is not trying to be “easy first” — it’s trying to be correct first.
- Public API stabilization
- Docs site (mdbook / Docusaurus)
- ZIO-style module layering (
Layer-like) - Metrics & tracing middleware
- Typed errors across HTTP + streams
If you want:
- a diagram of module dependencies
- a shorter npm-facing version
- or a ZIO comparison table
say the word.