Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Centrifugo Laravel Package

roadrunner-php/centrifugo

PHP client for Centrifugo with RoadRunner integration, helping you publish messages and manage real-time channels from your app. Lightweight package aimed at fast, scalable WebSocket/SSE push in PHP services.

View on GitHub
Deep Wiki
Context7
2.2.1

What's Changed

New Contributors

Full Changelog: https://github.com/roadrunner-php/centrifugo/compare/v2.2.0...2.2.1

v2.2.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: https://github.com/roadrunner-php/centrifugo/compare/2.0.0...v2.0.1

2.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 https://github.com/roadrunner-php/centrifugo/pull/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: https://github.com/roadrunner-php/centrifugo/compare/1.0.0...2.0.0

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation
uri-template/tests