Swoole – PHP asynchronous programming framework

Swoole is an high-performance network framework using an event-driven, asynchronous, non-blocking I/O model which makes it scalable and efficient. It is written in C language without 3rd party libraries as PHP extension. It enables PHP developers to write high-performance, scalable, concurrent TCP, UDP, Unix Socket, HTTP, WebSocket services in PHP programming language without too much […]

JavaScript asyncawait: Resolving Promises in parallel

Recently I saw a colleague implement some functionality in which he required two results from an API using async–await. The piece of code looked something like this: The code looks fine, is syntactically correct, and works … but there’s one big problem with it: the calls are made sequentially. To run these calls – which […]

Cancel a JavaScript Promise with AbortController

πŸ‘‹ This post also got published on Medium. If you like it, please give it some love a clap over there. In How to Cancel Your Promise Seva Zaikov has done a nice writeup on several techniques on how to cancel promises. After also touching generators and async/await the conclusion is that you can’t actually […]

Asynchronous stack traces: why await beats .then()

Insightful post by Mathias Bynens: The fundamental difference between await and vanilla promises is that await X() suspends execution of the current function, while promise.then(X) continues execution of the current function after adding the X call to the callback chain. In the context of stack traces, this difference is pretty significant. The gist is that […]