Packages

Cooperative concurrency for Skuld: FiberPool scheduler, Channel, Brook streaming, Yield, and AsyncCoroutine process bridging.

Current section

Files

Jump to
skuld_concurrency lib skuld coroutine completed.ex
Raw

lib/skuld/coroutine/completed.ex

defmodule Skuld.Coroutine.Completed do
@moduledoc """
Fiber that finished successfully.
## Env semantics
`env` is the final environment snapshot — scope, accumulated state
(Writer logs, State values, etc.) as they were when the computation
returned. The scheduler extracts `env.state` into shared pool state.
"""
alias Skuld.Comp.Env
@type t :: %__MODULE__{
id: term(),
result: term(),
env: Env.t()
}
defstruct [:id, :result, :env]
end