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 foreign_suspended.ex
Raw

lib/skuld/coroutine/foreign_suspended.ex

defmodule Skuld.Coroutine.ForeignSuspended do
@moduledoc """
Fiber state when a single fiber suspends on a foreign resource.
The FiberPool scheduler collects all `ForeignSuspended` fibers, extracts
their individual `ForeignSuspend` values, and bundles them into a
`Coroutine.ForeignSuspensions` aggregate to return to the caller.
"""
alias Skuld.Comp.Env
alias Skuld.Comp.ForeignSuspend
@type t :: %__MODULE__{
id: term(),
suspend: ForeignSuspend.t(),
env: Env.t()
}
defstruct [:id, :suspend, :env]
end