https://github.com/chubbyphp/chubbyphp-workerman-request-handler
A request handler adapter for workerman, using PSR-7, PSR-15 and PSR-17.
https://github.com/chubbyphp/chubbyphp-workerman-request-handler
chubbyphp psr-15 psr-17 psr-7 request-handler workerman
Last synced: 5 months ago
JSON representation
A request handler adapter for workerman, using PSR-7, PSR-15 and PSR-17.
- Host: GitHub
- URL: https://github.com/chubbyphp/chubbyphp-workerman-request-handler
- Owner: chubbyphp
- License: mit
- Created: 2020-08-06T14:15:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-12T14:09:12.000Z (10 months ago)
- Last Synced: 2025-07-17T02:05:41.985Z (5 months ago)
- Topics: chubbyphp, psr-15, psr-17, psr-7, request-handler, workerman
- Language: PHP
- Homepage:
- Size: 67.4 KB
- Stars: 14
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chubbyphp-workerman-request-handler
[](https://github.com/chubbyphp/chubbyphp-workerman-request-handler/actions/workflows/ci.yml)
[](https://coveralls.io/github/chubbyphp/chubbyphp-workerman-request-handler?branch=master)
[](https://dashboard.stryker-mutator.io/reports/github.com/chubbyphp/chubbyphp-workerman-request-handler/master)
[](https://packagist.org/packages/chubbyphp/chubbyphp-workerman-request-handler)
[](https://packagist.org/packages/chubbyphp/chubbyphp-workerman-request-handler)
[](https://packagist.org/packages/chubbyphp/chubbyphp-workerman-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-workerman-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-workerman-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-workerman-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-workerman-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-workerman-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-workerman-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-workerman-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-workerman-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-workerman-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-workerman-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-workerman-request-handler)
## Description
A request handler adapter for workerman, using PSR-7, PSR-15 and PSR-17.
## Requirements
* php: ^8.2
* [psr/http-factory][2]: ^1.1
* [psr/http-message][3]: ^1.1|^2.0
* [psr/http-server-handler][4]: ^1.0.2
* [psr/log][5]: ^2.0|^3.0.2
* [workerman/workerman][6]: ^4.2.1
## Installation
Through [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-workerman-request-handler][1].
```sh
composer require chubbyphp/chubbyphp-workerman-request-handler "^2.2"
```
## Usage
```php
count = 4;
$http->onWorkerStart = function () {
echo 'Workerman http server is started at http://0.0.0.0:8080'.PHP_EOL;
};
$http->onMessage = new OnMessage(
new PsrRequestFactory(
new ServerRequestFactory(),
new StreamFactory(),
new UploadedFileFactory()
),
new WorkermanResponseEmitter(),
$app
);
Worker::runAll();
```
### with blackfire
```php
onMessage = $onMessage;
```
### with newrelic
```php
onMessage = $onMessage;
```
## Copyright
2025 Dominik Zogg
[1]: https://packagist.org/packages/chubbyphp/chubbyphp-workerman-request-handler
[2]: https://packagist.org/packages/psr/http-factory
[3]: https://packagist.org/packages/psr/http-message
[4]: https://packagist.org/packages/psr/http-server-handler
[5]: https://packagist.org/packages/psr/log
[6]: https://packagist.org/packages/workerman/workerman