voryx/thruway-subscription-meta

Subscription Meta Module for Thruway library

0.2.0 2017-12-19 15:55 UTC

This package is auto-updated.

Last update: 2024-11-19 09:42:18 UTC


README

  • Thruway Subscription Meta Module

This is a module for the Thruway router that provides subscription meta events.

This module only implements the events portion of the spec.

This module does not group subscriptions. Every subscription will cause a on_create and on_subscribe event.

  • Use

The module can be added to the router to provide meta events for all realms:

$router = new Router();
$router->registerModules([
    new RatchetTransportProvider(),
    new SubscriptionMetaModule()
]);

$router->start();

or as a realm module to provide meta events on individual realms:

$router = new Router();
$router->registerModules([
    new RatchetTransportProvider()
]);

$realm = $router->getRealmManager()->getRealm('some_realm');
$realm->addModule(new SubscriptionMetaModule());

$router->start();