mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 14:33:14 +00:00
Address PR comments
This commit is contained in:
@@ -27,18 +27,27 @@ class PhraseanetWampServer implements WampServerInterface
|
||||
$this->manager = $manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function onPublish(Conn $conn, $topic, $event, array $exclude, array $eligible)
|
||||
{
|
||||
$this->logger->error(sprintf('Publishing on topic %s', $topic->getId()), array('event' => $event, 'topic' => $topic));
|
||||
$topic->broadcast($event);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function onCall(Conn $conn, $id, $topic, array $params)
|
||||
{
|
||||
$this->logger->error(sprintf('Received RPC call on topic %s', $topic->getId()), array('topic' => $topic));
|
||||
$conn->callError($id, $topic, 'RPC not supported on this demo');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function onSubscribe(Conn $conn, $topic)
|
||||
{
|
||||
if ($this->manager->subscribe($conn, $topic)) {
|
||||
@@ -48,24 +57,36 @@ class PhraseanetWampServer implements WampServerInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function onUnSubscribe(Conn $conn, $topic)
|
||||
{
|
||||
$this->logger->debug(sprintf('Unsubscription received on topic %s', $topic->getId()), array('topic' => $topic));
|
||||
$this->manager->unsubscribe($conn, $topic);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function onOpen(Conn $conn)
|
||||
{
|
||||
$this->logger->debug('[WS] Connection request accepted');
|
||||
$this->manager->openConnection($conn);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function onClose(Conn $conn)
|
||||
{
|
||||
$this->logger->debug('[WS] Connection closed');
|
||||
$this->manager->closeConnection($conn);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function onError(Conn $conn, \Exception $e)
|
||||
{
|
||||
$this->logger->error('[WS] Connection error', ['exception' => $e]);
|
||||
|
@@ -16,7 +16,7 @@ use Alchemy\Phrasea\Websocket\Topics\TopicsManager;
|
||||
interface PluginInterface
|
||||
{
|
||||
/**
|
||||
* Attaches a Plugn to the TopicsManager
|
||||
* Attaches a Plugin to the TopicsManager
|
||||
*
|
||||
* @param TopicsManager $manager
|
||||
*/
|
||||
|
Reference in New Issue
Block a user