Skip to content

Releases: roadrunner-php/centrifugo

v2.2.0

22 Jul 07:44
9787239
Compare
Choose a tag to compare

What's Changed

  • Added support for google/protobuf v4.x by @msmakouz in #13

Full Changelog: v2.1.0...v2.2.0

v2.1.0

11 Apr 17:40
54f92a4
Compare
Choose a tag to compare

What's Changed

Full Changelog: v2.0.1...v2.1.0

v2.0.1

06 Mar 13:47
8ffc623
Compare
Choose a tag to compare

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

14 Apr 12:04
9b48bfa
Compare
Choose a tag to compare

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

15 Nov 15:38
5b6e67e
Compare
Choose a tag to compare