skuld_concurrency

Coroutine > | Umbrella →

Cooperative coroutines, streaming, and concurrency for the Skuld effect system.

What's included

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.


Coroutine > | Umbrella →