v0.2.0 2018-05-02 13:03 UTC

This package is not auto-updated.

Last update: 2024-05-12 22:03:33 UTC


NOTE - This repository is no longer maintained

Ratchet Stack

Latest Stable Version Total Downloads License

Builder for ratchet middlewares based on ComponentInterface.

Ratchet Stack Builder is a small library that helps you construct a nested ComponentInterface decorator tree. It models it as a stack of middlewares.

Inspired of StackPHP


composer require gos/ratchet-stack


use Gos\Component\RatchetStack\Builder;
use React\Socket\Server;
use React\EventLoop\Factory;

$stack = new Builder();
$loop = Factory::create();

$socket = new Server($loop);
$socket->listen($this->port, $this->host);

	->push('Ratchet\Server\IoServer', $socket, $loop)
	->push('Ratchet\Session\SessionProvider', $this->sessionHandler)

$wampApplication = new WampApplication(); //Instance of WampServerInterface

$app = $stack->resolve($wampApplication); //Give IoServer instance