Posts
Learning python async, fast events and slow listeners
Recently, I was experimenting with writing Python asynchronous scripts, and one particular case in which I was interested is emitting events and processing them with listeners.
My objective was to investigate how event listeners would behave when the emitter is faster than the listeners. Would they queue events and process them as a kind of FIFO queue? Or would they handle events simultaneously in parallel? Or is there another possibility? But first, let’s examine how I arrived at using specific library and workflow.
Initially, I considered using part of the standard Python library, asyncio, particularly the Event class. However, I realized that it is more focused on coroutine synchronization (such as signaling when a resource has become available) rather than implementing a true emit-subscribe model.
Below is an example of using standard Python events
subscribe via RSS