Snakepit.Internal.TimeoutRunner (Snakepit v0.13.0)

Copy Markdown View Source

Bounded-time function execution using spawn_monitor and receive.

Provides a single run/2 function that executes a zero-arity function in a monitored process with an explicit timeout. Used by the executor, Python package runner, and shutdown modules as a replacement for Task.async/yield.

Summary

Functions

run(fun, timeout_ms)

@spec run((-> term()), non_neg_integer()) ::
  {:ok, term()} | :timeout | {:error, term()}