
Server accepts single Observable object (was Chain of Responsibility) WebSocket is decorator of application implementing Observable Observable interface returns Command pattern object Interfaced all the things Code is a mess Unit tests are broken
10 lines
195 B
PHP
10 lines
195 B
PHP
<?php
|
|
namespace Ratchet;
|
|
|
|
interface SocketObserver {
|
|
function onOpen(SocketInterface $conn);
|
|
|
|
function onRecv(SocketInterface $from, $msg);
|
|
|
|
function onClose(SocketInterface $conn);
|
|
} |