Aaron Barczewski
My name is Aaron Barczewski and I am a PHP developer with over seven years experience working in the marketing and telecommunication industry. I specialize in the design and implementation of microservices through API-driven architecture. I graduated from Colorado State University in 2016 with a bachelor’s degree in Computer Science. I served in the US Army as an intelligence analyst and was deployed to Afghanistan in 2010. In my free time I like to go out and take pictures of space objects (astrophotography), design and build rockets, and I play the drums.
# Special Thanks
I would like to thank Larry Garfield, the creator of the Serde library, for his help in reviewing and providing valuable insights for this article.
Articles
Implementing Asynchronous Listeners with Serde
By Aaron Barczewski
An event-listener system enhances code modularity and reduces redundancy. By utilizing the PSR-14 standard for event dispatching, a simple synchronous event dispatcher can be created that loops through and executes all listeners subscribed to an event. However, this approach has a major drawback: if one listener fails, all subsequent listeners subscribed to the same event will also fail. A solution to this problem is to execute listeners asynchronously using a queue. This method allows listeners to run independently, ensuring that the status of one listener does not affect the execution of the remaining listeners. Additionally, it enables retry and delay functionality, allowing an engineering team to implement listeners in parallel. by Aaron Barczewski
Published in PHP Is Listening, September 2024