skuld_concurrency
Cooperative coroutines, streaming, and concurrency for the Skuld effect system.
What's included
Skuld.Coroutine— cooperative fiber primitive with typed statesSkuld.Effects.FiberPool— cooperative scheduler with structured concurrencySkuld.Effects.Channel— bounded channels with backpressure and error propagationSkuld.Effects.Brook— streaming combinators (map, filter, flat_map, etc.)Skuld.AsyncCoroutine— cross-process bridge for LiveView and GenServerSkuld.Effects.Task— BEAM process parallelism within FiberPool
Installation
def deps do
[
{:skuld_concurrency, "~> 0.32"}
]
end
Quick start
use Skuld.Syntax
alias Skuld.Effects.{Yield, FiberPool}
comp do
results <- FiberPool.map(1..4, fn i ->
comp do
Yield.yield(i * 2)
end
end)
results
end
|> Yield.with_handler()
|> FiberPool.with_handler()
|> Comp.run!()
#=> [2, 4, 6, 8]
See the architecture guide for how this fits into the Skuld ecosystem.