Skip to content

Instantly share code, notes, and snippets.

View skovtunenko's full-sized avatar
🤠

Sergio Kovtunenko skovtunenko

🤠
View GitHub Profile
@skovtunenko
skovtunenko / ordered_parallel.go
Created October 20, 2017 07:36 — forked from marianogappa/ordered_parallel.go
Parallel processing with ordered output in Go
/*
Parallel processing with ordered output in Go
(you can use this pattern by importing https://github.com/MarianoGappa/parseq)
This example implementation is useful when the following 3 conditions are true:
1) the rate of input is higher than the rate of output on the system (i.e. it queues up)
2) the processing of input can be parallelised, and overall throughput increases by doing so
3) the order of output of the system needs to respect order of input
- if 1 is false, KISS!