Releases: roadrunner-php/centrifugo
Releases · roadrunner-php/centrifugo
v2.2.0
v2.1.0
v2.0.1
Bug fixes
- In the
RoadRunner\Centrifugo\Payload\Disconnect
class, the reconnect parameter is declared as deprecated and is no longer used.
Full Changelog: 2.0.0...v2.0.1
v2.0.0
Features
- Upgraded to PHP 8.1
- Upgraded to PHPUnit 10
- Upgraded to Psalm 5
- Added reusable Gh Actions
- Added metapackage spiral/roadrunner:^2023
Breaking Changes
Generated proto DTO files
Local proto DTO files were replaced with files from roadrunner-php/roadrunner-api-dto
package
RoadRunner\Centrifugo\Service\DTO\... => RoadRunner\KV\DTO\V1\...
RoadRunner\Centrifugo\DTO\... => RoadRunner\Centrifugal\Proxy\DTO\V1\...
Added sub refresh proxy request
<?php
require __DIR__ . '/vendor/autoload.php';
use RoadRunner\Centrifugo\CentrifugoWorker;
use RoadRunner\Centrifugo\Payload;
use RoadRunner\Centrifugo\Request;
use RoadRunner\Centrifugo\Request\RequestFactory;
use Spiral\RoadRunner\Worker;
$worker = Worker::create();
$requestFactory = new RequestFactory($worker);
// Create a new Centrifugo Worker from global environment
$centrifugoWorker = new CentrifugoWorker($worker, $requestFactory);
while ($request = $centrifugoWorker->waitRequest()) {
if ($request instanceof Request\SubRefresh) {
try {
// Do something
$request->respond(new Payload\SubRefreshResponse(
// ...
));
} catch (\Throwable $e) {
$request->error($e->getCode(), $e->getMessage());
}
continue;
}
}
Note
Read more about Sub Refresh request on the official documentation
by @butschster in #8
Added invalid request type
<?php
require __DIR__ . '/vendor/autoload.php';
use RoadRunner\Centrifugo\CentrifugoWorker;
use RoadRunner\Centrifugo\Payload;
use RoadRunner\Centrifugo\Request;
use RoadRunner\Centrifugo\Request\RequestFactory;
use Spiral\RoadRunner\Worker;
$worker = Worker::create();
$requestFactory = new RequestFactory($worker);
// Create a new Centrifugo Worker from global environment
$centrifugoWorker = new CentrifugoWorker($worker, $requestFactory);
while ($request = $centrifugoWorker->waitRequest()) {
if ($request instanceof Request\Invalid) {
$errorMessage = $request->getException()->getMessage();
if ($request->getException() instanceof \RoadRunner\Centrifugo\Exception\InvalidRequestTypeException) {
$payload = $request->getException()->payload;
}
// Handle invalid request
// $logger->error($errorMessage, $payload ?? []);
continue;
}
}
Full Changelog: 1.0.0...2.0.0
v1.0.0
Init project
Full Changelog: https://github.com/roadrunner-php/centrifugo/commits/1.0.0