Flask: Server-Sent Events(SSE) [in Python]

Here we are discussing the implementation of Server-Server Events(SSE) using Python, specifically using the Flask framework. We are discussing 2 ways to implement SSE in Flask-Using Flask Features (without any extra package) and using Flask-SSE package.

Design Pattern: State Pattern

In State pattern, an object (context object) changes its behavior when a certain internal state is changed. On state change the context object will change its behavior completely- like for performing a certain operation the context object will use different objects when the state is changed. This state change is managed internally so the client which is using the context object might not be aware of the state change.

Design Pattern: State Pattern in Java

State pattern is used to change the behavior of an object when the state is changed. With the change in state, the behavior of that object is completely changed. This article demonstrates State pattern implementations in Java.

Design Pattern: Observer Pattern

Observer pattern deals with state change between related objects. When one object depends on any state of another object, then when the state changes the dependent object needs to be notified. Observer pattern enables the dependent objects to subscribe to the state change of the subject object.

Design Pattern: Observer Pattern in Java

Observer pattern is used to automatically notify state change in object to all its dependent objects. It works as a pub/sub for state change between objects. This article demonstrates Observer pattern implementations in Java.

Design Pattern: Memento Pattern

Memento pattern is responsible for maintaining the history of state change of an object. By keeping the history, Memento pattern ensures that we can check the object state history at any point, and also can revert any state change and move to the previous state.

Design Pattern: Memento Pattern in Java

Memento pattern is used to store the history of state changes of an object so that that history can be used to track back the change or be used for some other purpose. This article demonstrates Memento pattern implementations in Java.

Design Pattern: Mediator Pattern in Java

Mediator pattern is used to restrict direct interaction between objects. A mediator class works as the middleman/communicator when one object wants to connect/use another object. This article demonstrates Mediator pattern implementations in Java.

Design Pattern: Mediator Pattern

Mediator pattern prevents direct interaction between objects and works as a middleman. As objects can not refer to another object directly in this pattern, that’s why it ensures loose coupling. In Mediator pattern, all communication between objects will be through the Mediator.

Design Pattern: Iterator Pattern

Iterator pattern is used when we need to traverse through a list of items. Iterator pattern hides the complexity of the iteration process and makes it easier to go through a list of items.