shigoto_middleware (shigoto v1.9.10)
View SourceComposable middleware chain for job execution.
Middleware wraps job execution with before/after logic. Each middleware
is a function that receives the job map and a Next function. Call Next()
to continue the chain, or return early to short-circuit.
Writing Middleware
my_middleware(Job, Next) ->
%% Before
logger:info(\"starting job\", #{job_id => maps:get(id, Job)}),
Result = Next(),
%% After
logger:info(\"finished job\", #{job_id => maps:get(id, Job)}),
Result.Middleware Order
Built-in middleware runs in this order:
- Logger metadata (sets structured log context)
- Seki resilience (rate limit, bulkhead, circuit breaker)
- Global middleware (from config)
- Worker middleware (from worker callback)
- Worker:perform/1
Summary
Functions
Build a composed function from a middleware list.
Run the full middleware chain for a job.