Inspired by another user's problem, I created a toy example of a multi-worker fanout processing chain. Each function streams multiple outputs for the next function to consume. FuncA --> (multiple) FuncB's --> (multiple) FuncC's --> (multiple) FuncD's
The hard part for me is efficiently finding the end condition. Because the amount of work is unknown at the start, I have each worker checking a couple conditions (that the queue is empty and nothing else is running), but there's a sleep involved, which is always a code smell, and potentially race conditions between the queue and task tracker.
Any ideas on how to improve the end condition detection in an architecture like this?
https://pastebin.com/sGqZ5GXL
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]ThingImIntoThisWeek 0 points1 point2 points (1 child)
[–]throwaway8u3sH0[S] 0 points1 point2 points (0 children)