What is "worker" design pattern?
Asked
Active
Viewed 2.4k times
7
-
1Do you mean the master/worker pattern? – Fred Foo Feb 09 '11 at 13:34
-
When I think of "worker" I can't help think about "jobs" -- workers do jobs. Workers handle the queueing/dispatching of jobs, and jobs are discrete units of work, potentially with some state like "repeatable", etc. – David James Oct 28 '15 at 15:12
2 Answers
7
It could be that you are after a worker thread pattern, where you use a queue to schedule tasks that you want to be processed "offline" by a worker thread. Some solutions will use a pool of worker threads instead of single thread to achieve performance gains by utilising paralelisation.

Martijn Pieters
- 1,048,767
- 296
- 4,058
- 3,343

Dalibor Novak
- 575
- 5
- 17
1
Something like MapReduce comes to mind. Where multiple tasks can be performed in parallel on worker nodes.
Edit: As @larsmans mentioned, this is known as the Master/Worker pattern.

Viral Shah
- 2,888
- 2
- 22
- 25
-
1Dead link try https://docs.gigaspaces.com/sbp/master-worker-pattern.html – wmitchell Mar 07 '18 at 17:55
-
Obsolete link, use https://docs.gigaspaces.com/solution-hub/master-worker-pattern.html – Mushaheed Syed Aug 27 '20 at 03:47