Awesome
<div align="center">Awesome Swoole
A curated list of awesome things related to <a href="//github.com/swoole/swoole-src">Swoole</a>.
<img width="200" height="120" align=center alt="Swoole Logo" src="https://cdn.jsdelivr.net/gh/sy-records/staticfile/images/swoole/logo.png"> </div>Table of Contents
NOTE: Projects labelled with emoji :globe_with_meridians: have their documentation written in non-English languages.
Architectural
Libraries related to design patterns, programming approaches and ways to organize code.
- leocarmo/circuit-breaker-php - PHP implementation of Circuit Breaker Pattern.
- Phluxor - An implementation of the Actor model for PHP.
Client Packages
- hyperf/jet - An RPC Client with built-in support for the JSON-RPC protocol. It works with both PHP-FPM and Swoole.
- hyperf/consul - The Consul client of Hyperf.
- hyperf/elasticsearch - The Elasticsearch client of Hyperf.
- hyperf/etcd - The etcd client of Hyperf.
- simps/mqtt - A coroutine-based MQTT client. It supports MQTT version 3.1, 3.1.1, and 5.0.
- swoole/ext-postgresql - A Swoole-based PostgreSQL client.
- swoole/ext-zookeeper - A Swoole-based ZooKeeper client. :globe_with_meridians:
Cronjobs
- hyperf/crontab - The cron component of Hyperf, allowing jobs to run at intervals of seconds.
- osgochina/swoole-crontab - A Swoole-based crontab schedule. It allows jobs to run at intervals of seconds, and is fully compatible with crontab syntax. :globe_with_meridians:
Database
- hyperf/database - The database component of Hyperf.
- mix/database - A Swoole-based database component, with built-in support for connection pool. :globe_with_meridians:
- mix/redis - A Swoole-based Redis component, with built-in support for connection pool. :globe_with_meridians:
- mix/redis-subscriber - A Swoole-based Redis subscription component. :globe_with_meridians:
- open-smf/connection-pool - A common connection pool based on Swoole.
- simple-swoole/db - The database component of Simps. This component is built on top of the Swoole Library.
- SMProxy - SMProxy (Swoole MySQL Proxy), A MySQL database connection pool library. :globe_with_meridians:
Debugging and Profiling
- Blackfire - A low-overhead code profiler.
- upscale/swoole-blackfire - Blackfire profiler integration for Swoole web-server.
- SkyAPM PHP - The PHP instrument agent for Apache SkyWalking.
- swoole/debugger - A remote debugger of Swoole. By adding one-line of code, you can debug your application remotely using a rich list of commands. :globe_with_meridians:
- Xdebug - A debug and profile tool for PHP. Xdebug 3.1.0+ works with Swoole 5.0.2+ on PHP 8.1+ only. Lower versions of Xdebug don't work with Swoole.
yasd- Yet Another Swoole Debugger, developed by codinghuang from the Swoole team. It's no longer actively maintained, and only works with lower versions of Swoole (Swoole < 5.0) and PHP (PHP <= 8.0). Please use Xdebug instead for latest versions of Swoole and PHP.
Development Environment
- Docker
- adhocore/lemp - A single container LEMP complete fullstack with latest releases of PHP (7.4 - 8.3) and MySQL, nginx, PostgreSQL, phalcon, swoole, mailcatcher, beanstalkd, elasticsearch, memcached, redis, adminer and all you ever need.
- phpswoole/swoole - Official Docker image of Swoole.
- IDE Helper
- eaglewu/swoole-ide-helper - Auto completion, trigger suggest and view docs for Swoole in editor.
- Swoole IDE Helper - Swoole IDE Helper for PhpStorm and Intellij IDEA. Thanks to Luhur Abdi (Abi) Rizal for maintaining it.
- swoole/ide-helper - IDE help files to provide accurate autocompletion for Swoole.
Distribution
- shivammathur/extensions - 🍻 Homebrew tap for PHP extensions.
- static-php-cli - Build static PHP binary in Linux, with Swoole and other popular extensions included. :globe_with_meridians:
- swoole-cli - A prebuilt executable to run Swoole applications directly. No PHP installation required (just download and use it). Support Linux, macOS, and Windows. :globe_with_meridians:
Frameworks
- chubbyphp-framework: A minimal middleware based micro framework using PSR, with the goal is to achive the best combination of flexibility and simplicity by using standards.
- Fomo - A simple, fast framework with many features for the HTTP. It was ranked as the fastest PHP framework in the world since 2022-10-16 (and still is as of 2022-11-30) by the Web Frameworks Benchmark project.
- Hyperf - A coroutine framework that focuses on hyperspeed and flexibility.
- Official components (an incomplete list)
- Third-party components (an incomplete list)
- friendsofhyperf/components - Some most popular third-party components for Hyperf.
- 96qbhy/hyperf-auth - An authentication component for Hyperf. It supports JWT and session-based authentications. You can also create your own authentication drivers if needed. :globe_with_meridians:
- opencodeco/hyperf-doctrine - This project provides an integration for the Doctrine ORM and the Hyperf framework.
- reasno/fastmongo - A coroutine-based MongoDB client for Hyperf.
- LightMVC - A modular, event-driven and Swoole-enabled framework that allows to easily create PHP applications by using any PHP library.
- Nano - A Hyperf-based coroutine microframework.
- imi - A Swoole-based framework, with built-in support for HTTP/1, HTTP/2, WebSocket, TCP, UDP, and MQTT. :globe_with_meridians:
- Laminas/Mezzio/Zend Framework
- mezzio/mezzio-swoole - Provides the support of Swoole into a Mezzio application.
- Siler - A set of general purpose high-level abstractions aiming an API for declarative programming in PHP. Note: This repository has been archived by the owner.
- lizhichao/one - A simple and efficient framework that works both under PHP-FPM and Swoole.
- Mix PHP - A unique single-threaded coroutine-based framework. :globe_with_meridians:
- Official modules (an incomplete list)
- Polyel - A full-stack MVC PHP framework/server built from the ground up based on Swoole.
- Resonance - Designed from the ground up to facilitate interoperability and messaging between services in your infrastructure and beyond.
- Official documentation: https://resonance.distantmagic.com/
- QueryPHP - A modern, high performance PHP progressive coroutine framework. :globe_with_meridians:
- Simps - A simple, lightweight and high-performance PHP coroutine framework.
- Ubiquity - A powerful and fast framework for efficient design.
Framework Integration
To run PHP/PHP-FPM frameworks using Swoole.
- PHP Runtimes - A home for runtimes, where people can easily create a
Runtime
to run an application with Bref, Swoole or ReactPHP without making any change to the application itself. - Drupal
- The Swoole module for Drupal - The Swoole module for Drupal supercharges your website's performance by serving it via the Swoole or the OpenSwoole PHP server. The (Open)Swoole PHP server boots Drupal once, keeps it in memory and then feeds it requests at supersonic speeds. Thanks to daffie.
- Laravel
- Laravel Octane - A first-party Laravel package that supercharges laravelish application's performance by serving it using Swoole high-performance HTTP servers. Developed and maintained by the Laravel team.
- hhxsv5/laravel-s - An out-of-the-box adapter between Laravel/Lumen and Swoole.
- huang-yi/shadowfax - Runs your Laravel application on Swoole.
- scil/laravel-fly - To be an absolutely safe solution to speed up Laravel with Swoole. Preloading + Coroutine and Tinker Online.
- swooletw/laravel-swoole - A high-performance HTTP server to run Laravel/Lumen application on top of Swoole.
- toxmc/fast-laravel - A Swoole-based high-performance HTTP server to speed up your Laravel applications. :globe_with_meridians:
- Phalcon
- phwoolcon/phwoolcon - Phalcon + Swoole.
- Slim
- pachico/Slim-Swoole - A convenient library to run SlimPHP applications with Swoole.
- Symfony
- swoole-bundle/swoole-bundle - Symfony integration with Swoole or Open Swoole to speed up your applications.
- symfony/runtime - The Runtime component decouples the bootstrapping logic from any global state to make sure the application can run with runtimes like PHP-FPM, ReactPHP, Swoole, etc. without any changes. For a more generic implementation that works with other frameworks/environments, please check project PHP Runtimes.
- ThinkPHP
- topthink/think-swoole - To run ThinkPHP applications with Swoole. :globe_with_meridians:
- Yii
- liufee/yii2-swoole - To run Yii 2 applications with Swoole. :globe_with_meridians:
- Utopia - A PHP MVC based framework with minimal must-have features for professional, simple, advanced and secure web development.
- Utopia Swoole - An extension for Utopia Framework to work with PHP Swoole as a PHP FPM alternative.
- WordPress
- WordPress Swoole - To run WordPress in Swoole. #WIP
gRPC
- hyperf/grpc-client - The gRPC client component of Hyperf.
- hyperf/grpc-server - The gRPC server component of Hyperf.
- mix/grpc - A gRPC implementation based on Swoole. Protoc code generator, server, client, and more features included. :globe_with_meridians:
- swoole/grpc - An efficient Swoole-based gRPC client. :globe_with_meridians:
HTTP and WebSocket
Libraries for working with HTTP and WebSocket.
- PSR Compliance
- chubbyphp/chubbyphp-swoole-request-handler - A request handler adapter for Swoole, using PSR-7, PSR-15 and PSR-17.
- leocavalcante/request-callback - Swoole request callback for PSR compliant handlers. Compatible with PSR-7 and PSR-15.
- fastd/http - A PSR-7-compatible HTTP component, with built-in support for Swoole HTTP server. :globe_with_meridians:
- razonyang/psr7-swoole - A PSR-7 helper for Swoole; a bridge between Swoole and PSR things, such as PSR-7 HTTP message, PSR-15 handlers and PSR-15 middlewares.
- Saber - A coroutine-based HTTP client. :globe_with_meridians:
- Yurunsoft/Guzzle-Swoole - Make the Guzzle library coroutine-friendly in Swoole. It works with many Guzzle-based packages and Swoole-based frameworks. :globe_with_meridians:
- Yurunsoft/YurunHttp - An easy-to-use HTTP client that works with HTTP/1, HTTP/2, and WebSocket protocols. It also supports chained operations, concurrent processing, and connection pool. :globe_with_meridians:
- Utopia WebSocket - A simple and lite abstraction layer around a WebSocket server. This library is aiming to be as simple and easy to learn and use.
Logging
- hyperf/logger - The logging component of Hyperf. It's based on Monolog, with PSR-3 interface implemented.
- mix/monolog - A coroutine-friendly logging library. It's based on Monolog. :globe_with_meridians:
- open-telemetry/context-swoole - Async Swoole/OpenSwoole context implementation for OpenTelemetry PHP.
- upscale/swoole-newrelic - New Relic APM and Browser monitoring of Swoole web-server.
Serverless
- Swoole Runtime for AWS Lambda - λ Run PHP Coroutines & Fibers as-a-Service on the AWS Lambda.
SOA governance
- hyperf/tracer - The distributed tracing component of Hyperf. The implementation is based on OpenTracing.
- mix/tracing-zipkin - A tracing library based on Zipkin and OpenTracing. :globe_with_meridians:
Tasks and Queues
- Archer - A Swoole-based task component, with different runtime modes supported: serial queue, concurrent queue, defer, timer, etc. :globe_with_meridians:
- hyperf/amqp - The AMQP client of Hyperf.
- hyperf/async-queue - The Redis-based asynchronous queue component of Hyperf.
- hyperf/task - The task component of Hyperf, providing an easy way to add and dispatch tasks to task workers in Swoole.
- kcloze/swoole-jobs - An efficient Swoole-based job queue system. :globe_with_meridians:
- littlesqx/aint-queue - An async-queue library built on top of Swoole.
- longlang/phpkafka - A coroutine-based Kafka client.
Testing
- deminy/counit - To run time/IO related unit tests (e.g., sleep function calls, database queries, API calls, etc) faster using Swoole.
Third-party SDK
- yansongda/pay - A payment SDK for Alipay and WeChat Pay, with components to integrate with Hyperf, Laravel, and Yii. :globe_with_meridians:
- Yurunsoft/PaySDK - A coroutine-friendly payment SDK for Alipay and WeChat Pay. :globe_with_meridians:
- Yurunsoft/YurunOAuthLogin - An OAuth library that provides built-in support for QQ, WeChat, Weibo, Github, Gitee, etc. :globe_with_meridians:
Web Applications
Web-based applications and tools.
- HyperfAdmin - An administration panel built with Swoole, Hyperf, and Vue.js. :globe_with_meridians:
- MineAdmin - An administration panel built with Swoole, Hyperf, and Vue 3. :globe_with_meridians:
- wopits - A world of post-its - An app for managing projects online using sticky notes to share and collaborate. It uses Swoole as a WebSocket & Task server.
- yurun-crawler - A framework to build high-performance, distributed web crawler. :globe_with_meridians:
- zhamao-framework - A chatbot system based on an award-winning project in China. :globe_with_meridians:
Miscellaneous
- crowdstar/exponential-backoff - A library to prevent overloading an unavailable service by doubling the timeout each iteration. It works under both Swoole (in non-blocking mode) and PHP-FPM.
- Futures and Promises
- leocavalcante/swoole-futures - Futures + Async/Await for PHP's Swoole asynchronous run-time.
- Swoole Futures - Partial implementation of Promise/A+ spec based on Swoole Coroutines.
- hhxsv5/php-sse - A simple and efficient library implemented HTML5's server-sent events using PHP.
- k8s/client - A Kubernetes API client for PHP.
- leocavalcante/swoole-mutex - Mutual exclusion abstractions for PHP's Swoole concurrency run-time.
- mix/sync-invoke - A library to execute synchronous blocking code without blocking the running process in Swoole. :globe_with_meridians:
- Rubix ML - A high-level machine learning and deep learning library for the PHP language.
- Shlink Event Dispatcher - Event dispatching using PSR-14, with async event listener that are executed in swoole task system.
- xlswriter - A coroutine-friendly PHP Extension to create and read XLSX files.
- swoole-utils - A collection of utilities for building concurrent applications with Swoole. #WIP
Resources
Swoole Books
Fantastic Swoole-related books.
- Mastering Swoole PHP - Build your high performance large scale concurrent system in a more flexible and efficient way than ever before with this first & only Swoole PHP book, with PHP 8 ready.
- Swooleで学ぶPHP非同期処理 ~並行処理/並列処理の基礎から実践的な開発手法まで一気にわかる - Learning PHP asynchronous processing with Swoole: from the basics of parallel processing to practical development methods. The first Swoole book written in Japanese by めもりー :globe_with_meridians:
Swoole Videos
Fantastic Swoole-related videos.
- CSP Programming in PHP - An online talk presented by Demin on August 20, 2020. This talk gives an in depth explanation on the concurrency model used in Swoole. Here are the slides.
- Building High-Performance Application Servers with Swoole - A conference talk presented by Demin during PHPFest 2020. Here are the slides.
- Build an All-In-One Application Server Using Swoole - A conference talk presented by Demin during PHP Community Summit 2021. The talk starts at 20'55''. Here are the slides.
Miscellaneous
- deminy/swoole-by-examples - Learn Swoole by examples.
- swooletw/awesome-swoole - A curated list of Swoole.
Alternatives
- Open Swoole - A fork of Swoole that is maintained by the Open Swoole team.