Publish/subscribe events with Blinker
One of the many difficulties in the lifecycle of any nontrivial application is ensuring that the right level of modularity is present in the codebase.
There exist various methodologies to create interfaces, objects, and services and implementing design patterns that help us manage the ever-increasing complexity that is inevitably created for a real-world application. One methodology that is often left unexplored for web applications is the in-process publish-subscribe
design pattern.
Generally, publish-subscribe
, or more colloquially known as pub/sub, is a messaging pattern where two classes of participants exist: publishers and subscribers. Publishers send messages and subscribers subscribe to a subset of the messages that are produced via the topic (a named channel) or via the content of the message itself.
In large distributed systems, pub/sub is usually mediated by a message bus or broker that communicates with all the various publishers and subscribers...