PHP Swoole Articles and Tutorial

    The power of coroutine in PHP Swoole: Go, Chan and Defer

    Coroutine features are mature in PHP Swoole since version 4.x. Swoole provides the powerful CSP (Communicating sequential processes) programming model with three keywords: go, chan, defer.

    CSP is an alternative concurrent programming model to the actor model in Erlang or Akka. It is well known because it is adopted in Golang. The key concepts of CSP are:

    • Sequential processes
    • Synchronous communication through channels
    • Multiplexing of channels with alternation

    Version used in this article: Swoole 4.2.9 PHP 7.2.9

    Read more

    Speed up Laravel with PHP Swoole

    There are several open source libraries built for Laravel and Swoole integration: Laravel Swoole, Laravel-S.

    Read more

    Coroutine in PHP Swoole 4.x vs Coroutine in Golang

    The design of coroutine in PHP Swoole is similar to the coroutine in Golang:

    • Each coroutine has its own stack.
    • The context switching between different coroutine is controlled by the scheduler.

    But there are some differences between the coroutine in PHP Swoole and the coroutine in Golang:

    Read more

    Get started with Swoole 4.2.9 PHP 7.2 and Docker

    This article introduce how to get started with Swoole without manually compile the Swoole PHP extension.

    Docker make it easy for us to try Swoole with only several commands.

    Make sure you have installed Docker on your machine and updated the swoole version to be the latest version.

    Read more