Lockstep.Task.Supervisor (Lockstep v0.1.0)

Copy Markdown View Source

Lockstep-aware Task.Supervisor shim. Each async/start_child call spawns a managed Lockstep process; supervisor restart semantics aren't modeled (use Lockstep.Supervisor for that).

Sufficient for libraries that use Task.Supervisor.async/3-4 for fan-out under controlled scheduling -- tasks become regular Lockstep tasks.

Summary

Functions

Async on a supervisor; same shape as Lockstep.Task.async.

async_stream on a supervisor; same shape as Lockstep.Task.async_stream.

start_child returns {:ok, pid} for a managed process.

start_link(opts) -- returns a fake supervisor pid (just a managed process that does nothing). The returned pid can be passed back to async/start_child calls.

Functions

async(supervisor, fun)

Async on a supervisor; same shape as Lockstep.Task.async.

async(supervisor, module, fun, args)

async_stream(supervisor, enumerable, fun, opts \\ [])

async_stream on a supervisor; same shape as Lockstep.Task.async_stream.

async_stream(supervisor, enumerable, module, function, args, opts \\ [])

start_child(supervisor, fun)

start_child returns {:ok, pid} for a managed process.

start_child(supervisor, module, fun, args)

start_link(opts \\ [])

start_link(opts) -- returns a fake supervisor pid (just a managed process that does nothing). The returned pid can be passed back to async/start_child calls.