Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lobocv/gowork
Concurrency patterns for golang
https://github.com/lobocv/gowork
concurrency-patterns golang worker
Last synced: 1 day ago
JSON representation
Concurrency patterns for golang
- Host: GitHub
- URL: https://github.com/lobocv/gowork
- Owner: lobocv
- Created: 2020-04-30T02:07:51.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-05-04T14:58:52.000Z (over 4 years ago)
- Last Synced: 2023-08-28T02:04:20.535Z (about 1 year ago)
- Topics: concurrency-patterns, golang, worker
- Language: Go
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gowork
Concurrency patterns for golang.
These patterns were made for fun to see if generic worker patterns could be developed using closures.
They are NOT recommended for production.These concurrency patterns make use of closures to execute your tasks
## MutliTask
MultiTask can be used when you want to run several tasks in parallel and wait for them all to complete
## Batch
Batch can be used when you have a task you want to do for every item in a list but you want to limit
the number of items processed at any given time.## BufferedBatch
BufferedBatch can be used when you have a task you want to run for every X number of items in a slice. For example
if you have a slice [1, 2, 3, 4, 5, 6, 7, 8] and a buffer size of 3, it would run jobs for [1,2,3], [4, 5, 6], [7, 8]