River

River is a robust high-performance job processing system for Go and Postgres.
See [homepage], [docs], and [godoc], as well as the [River UI][riverui] and [its
live demo][riveruidemo].
Being built for Postgres, River encourages the use of the same database for
application data and job queue. By enqueueing jobs transactionally along with
other database changes, whole classes of distributed systems problems are
avoided. Jobs are guaranteed to be enqueued if their transaction commits, are
removed if their transaction rolls back, and aren't visible for work until
commit. See [transactional enqueueing] for more background on this philosophy.
Job args and workers
Jobs are defined in struct pairs, with an implementation of [JobArgs] and one
of [Worker].
Job args contain json annotations and define how jobs are serialized to and
from the database, along with a "kind", a stable string that uniquely identifies
the job.
type SortArgs struct {
// Strings is a slice of strings to sort.
Strings []string `json:"strings"`
}
func (SortArgs) Kind() string { return "sort" }
[Subscriptions]: https://riverqueue.com/docs/subscriptions
[docs]: https://riverqueue.com/docs
[driver]: https://riverqueue.com/docs/database-drivers
[godoc]: https://pkg.go.dev/github.com/riverqueue/river
[homepage]: https://riverqueue.com
[riverui]: https://github.com/riverqueue/riverui
[riveruidemo]: https://ui.riverqueue.com