Stars: 149
Forks: 19
Pull Requests: 0
Issues: 2
Watchers: 15
Last Updated: 2022-12-17 01:06:05
Learn Swoole by Examples
License: Other
Languages: Dockerfile, PHP
The repository is to help developers to get familiar with Swoole through a variety of examples. All the examples are fully functioning; they can be executed and verified using the Docker images provided.
NOTE: I'm adding examples for latest versions of Swoole, so please be patient.
We use Docker to setup our development environment. Other than Docker, you don't need to install any other software to run and test the examples: you don't need to have PHP, Swoole, Composer, or some other software installed locally.
We use the official Docker image of Swoole to run the examples. There are tens of examples under repository swoole/docker-swoole shown how to use the image. Please spend some time checking it first.
Before running the examples, please run command docker-compose up -d
under the root repository directory to start the
Docker containers. There are two containers used to run the examples:
Both containers have the same PHP scripts in place, so most standalone scripts (e.g., most CSP programming examples) can be executed from either container. Once the containers are running, you can use one of following commands to get a Bash shell in the containers:
docker compose exec -ti server bash # Get a Bash shell in the server container.
docker compose exec -ti client bash # Get a Bash shell in the client container.
How to detect/handle deadlocks
.resource pooling
for details.