https://github.com/zavalit/corouser
Coroutine based server written in php
https://github.com/zavalit/corouser
Last synced: 7 months ago
JSON representation
Coroutine based server written in php
- Host: GitHub
- URL: https://github.com/zavalit/corouser
- Owner: zavalit
- Created: 2015-02-10T10:43:44.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-06-09T16:26:51.000Z (over 10 years ago)
- Last Synced: 2024-04-10T04:29:24.302Z (almost 2 years ago)
- Language: PHP
- Homepage:
- Size: 211 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Corouser
[](https://travis-ci.org/zavalit/corouser)
## Coroutine based server written in php
#### Preview
Inspired by awesome [nikic aticle](https://nikic.github.io/2012/12/22/Cooperative-multitasking-using-coroutines-in-PHP.html), and is developed primaraly for the sake of learing a concept of coroutine in php, at this stage it is not for production at all.
#### Install it per Composer
composer require --dev zavalit/corouser:dev-master
##### and boot it
vendor/bin/server 8081
In example above **8081** is your port number and you are shurely free to choose any other port you wish
#### Install it and boot it per Docker
It can be obviously the case that you don't have php version >=5.5, in that case you can run it simply within docker container that has it.
#get the code
git clone https://github.com/zavalit/corouser.git
#go to the source code
cd corouser
#and run a container
docker run -d -p 8081:8081 -v $PWD:/var/www zavalit/corouser
#### And simply call it
in a browser
http://localhost:8081
or benchmark it
ab -n 10000 -c 1000 http://0.0.0.0:8081/