Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Cees-Jan Kiewiet:
ReactPHP with RecoilPHP: An introduction
Feb 05, 2018 @ 09:51:01

In a new post to his site Cees-Jan Kiewiet has posted in introduction to using asynchronous processing in your PHP application by using RecoilPHP and ReactPHP.

Getting your mind wrapped around async nature can be mind bending at first. But with RecoilPHP you can write code promise as if you're writing sync code.

He starts with some sample code showing the difference between normal ReactPHP and how the same kind of thing would be written using RecoilPHP. He then gets into the setup of a project that includes the RecoilPHP package and several others from React. With that base set up, he shows how to create a promise that opens a socket and listens on it for incoming messages and how to modify it to add additional coroutines. Finally he shares a few "bonus tips" and covers error handling.

tagged: recoilphp reactphp tutorial introduction asynchronous processing promise

Link: https://blog.wyrihaximus.net/2018/02/reactphp-with-recoilphp/