Skuld.PageMachine (skuld_concurrency v0.41.0)
View SourceLiveView integration for FiberPool.Server — a multi-fiber page machine with bidirectional message passing.
Usage
use Skuld.PageMachine,
tag: :checkout,
on_yield: &handle_yield/2,
on_complete: &handle_complete/2Multi-spindle mode
For pages with concurrent spindles, use /3 callbacks:
on_yield: &handle_yield/3
defp handle_yield(:cart, status, socket), do: ...
defp handle_yield(:checkout, step, socket), do: ...Event routing
By default, events go to the main fiber (the PMC tag). Use into:
to route to a specific spindle:
def_pipe_event "add_to_cart", :runner, into: :cart
def_pipe_event "submit_shipping", :runner
Summary
Functions
Cancel a running page machine and all its spindles.
Resume a yielded spindle with a value.
Start a page machine in a separate FiberPool.Server process.
Functions
Cancel a running page machine and all its spindles.
Resume a yielded spindle with a value.
Start a page machine in a separate FiberPool.Server process.