maxcountryman / underway

⏳ Durable step functions via Postgres.
Apache License 2.0
72 stars 2 forks source link

provide stateful jobs #9

Closed maxcountryman closed 1 month ago

maxcountryman commented 1 month ago

This adds a facility for setting shared state on jobs via the state method on the job builder. When state is provided, the execute function must accept input and state, in that order, as arguments.

Shared state is useful in a number of ways, including when resources like database pools, should be accessible to your jobs.

Furthermore, patterns like Arc<Mutex<T>> enable shared mutable state, where necessary.