Private
Public Access
1
0
Files
MineSeeker/src/Mine/SeekerBundle/Rpc/AcmeRpc.php

36 lines
834 B
PHP

<?php
namespace Mine\SeekerBundle\Rpc;
use Ratchet\ConnectionInterface;
use Gos\Bundle\WebSocketBundle\RPC\RpcInterface;
use Gos\Bundle\WebSocketBundle\Router\WampRequest;
class AcmeRpc implements RpcInterface
{
/**
* Adds the params together
*
* Note: $conn isnt used here, but contains the connection of the person making this request.
*
* @param ConnectionInterface $connection
* @param WampRequest $request
* @param array $params
* @return array
*/
public function addFunc(ConnectionInterface $connection, WampRequest $request, $params)
{
return array("result" => array_sum($params));
}
/**
* Name of RPC, use for pubsub router (see step3)
*
* @return string
*/
public function getName()
{
return 'acme.rpc';
}
}