Zhang WH be1c0b8143
Fix issue #179: Leader Followers Pattern (#1189)
* add leader followers pattern

* use var and streams instead in App::execute

* use logger instead of printing to system output stream
2020-03-26 21:14:44 +02:00
..

layout, title, folder, permalink, categories, tags
layout title folder permalink categories tags
pattern Leader/Followers leader-followers /patterns/leader-followers/ Concurrency
Performance

Intent

The Leader/Followers pattern provides a concurrency model where multiple threads can efficiently de-multiplex events and dispatch event handlers that process I/O handles shared by the threads.

Class diagram

Leader/Followers class diagram

Applicability

Use Leader-Followers pattern when

  • multiple threads take turns sharing a set of event sources in order to detect, de-multiplex, dispatch and process service requests that occur on the event sources.

Real world examples

Credits