Stdlib index
- Captured-borrow migration worklist (3.3.3)
- Owned-bind migration worklist (8.2.7)
- Return-side title audit — the ride-through enumeration
- stdlib ownership audit
- stdlib ownership dispositions (plan 1.3.1 / 4.3.1)
aot
codec
codec / csv
codec / json
collection
- ArrayList
- BPlusTree
- Cache
- Collectors
- HashMap
- HashSet
- Heap
- ImmutableList
- ImmutableMap
- ImmutableSet
- LinkedList
- RedBlackTree
- Sort
collection / ltm
concurrent
error
- Exception
- NoOptionalValueException
- NotProvidedException
- RecoverableException
- ScopedBuildFailedException
- ScopeNotActiveException
- Throwable
- UnrecoverableException
gfx
hash
ifx
io
io / file
io / net
io / net / dns
io / net / uri
lang
lang / stream
math
math / fft
math / linalg
math / npio
math / poly
math / random
math / stats
nucleo
- Columns — the Arrow-laid-out substrate
- Fused tensor expressions — Fuse
- Table — the lazy, typed dataframe
- Tape — define-by-run autograd
- Transform intrinsics — Grad, Vmap, Jit
process
reflect
search / distance
search / fuzzy
search / ngram
session
time
- Clock
- DateTimeFormatter
- Duration
- Instant
- LocalDate
- LocalDateTime
- LocalTime
- Period
- ZonedDateTime
- ZoneId
- ZoneOffset
wire
xpu
xpu / mesh
FiberLocal<T>
cajeta.concurrent.FiberLocal — ambient per-request state: a fiber-keyed,
scope-restored binding, the sound replacement for a thread-pool
ThreadLocal/MDC. Fibers are single-use, so a per-fiber binding has naturally
request-scoped lifetime and cannot leak into a later, unrelated request. A
child spawned inside a scope inherits the binding automatically; T may be
any type, reference or primitive — the value is boxed before being handed to
the per-fiber runtime store, so a primitive round-trips correctly.
FiberLocal<int64> requestId = heap FiberLocal<int64>();
requestId.where(42L, () -> {
int64 rid = requestId.orElse(0L); // 42 anywhere inside the extent
});
boolean bound = requestId.isBound(); // false — binding restored on return
Methods
| Signature | |
|---|---|
FiberLocal() ⚑ | A FiberLocal key; get() on an unbound fiber throws — use orElse/isBound |
void where(#T value, () -> void body) | Bind value for the dynamic extent of body, restoring the prior binding when body returns or throws |
T get() | The current binding; throws when unbound |
T orElse(T fallback) | The current binding, or fallback when unbound; never throws |
boolean isBound() | Whether a binding is in effect on the current fiber |
⚑ = @EntryPoint