https://github.com/igmagollo/go-sticky-worker-pool
simple zero-dependency key-sticky worker pool
https://github.com/igmagollo/go-sticky-worker-pool
go hash sticky worker-pool
Last synced: 5 months ago
JSON representation
simple zero-dependency key-sticky worker pool
- Host: GitHub
- URL: https://github.com/igmagollo/go-sticky-worker-pool
- Owner: igmagollo
- License: mit
- Created: 2024-07-04T19:57:56.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-05T12:47:39.000Z (almost 2 years ago)
- Last Synced: 2024-07-10T14:35:29.294Z (almost 2 years ago)
- Topics: go, hash, sticky, worker-pool
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-sticky-worker-pool

This is a very simple implementation of key-sticky concurrency over go routines.
Imagine you have an FIFO queue and you want to run jobs concurrently keeping ordering. Well, you can't guarantee though, but you can guarantee ordering of correlated workloads (e.g. workloads of the same user id, or the same aggregate id).
Besides that, it may reduce your lock management overhead, since correlated jobs will run in order, and possibly will help you avoid deadlocks.
This is achieved by using a consistent hash that delivers workloads with the same key to the same channel.