Slither.Dispatch.Runner (Slither v0.1.0)

Copy Markdown View Source

Internal engine that executes batches with bounded concurrency.

Uses Task.async_stream with max_concurrency to enforce the max_in_flight limit, providing real backpressure — upstream enumeration only advances when a worker slot is available.

Summary

Functions

Execute batches with bounded concurrency, returning all results in order.

Execute batches returning a lazy stream of results.

Types

on_error()

@type on_error() ::
  :skip
  | :halt
  | {:retry, keyword()}
  | {:route, (Slither.Item.t(), term() -> Slither.Item.t())}

Functions

run_batches(batches, executor, ctx, opts)

@spec run_batches(
  [{pos_integer(), [Slither.Item.t()]}],
  module(),
  Slither.Context.t(),
  keyword()
) :: {:ok, [Slither.Item.t()]} | {:error, term(), [Slither.Item.t()]}

Execute batches with bounded concurrency, returning all results in order.

stream_batches(batches, executor, ctx, opts)

@spec stream_batches(
  [{pos_integer(), [Slither.Item.t()]}],
  module(),
  Slither.Context.t(),
  keyword()
) :: Enumerable.t()

Execute batches returning a lazy stream of results.