7

What is "worker" design pattern?

Fred Foo
  • 355,277
  • 75
  • 744
  • 836
lital maatuk
  • 5,921
  • 20
  • 57
  • 79
  • 1
    Do 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 Answers2

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