示例#1
0
 public function __construct(Client $client)
 {
     $this->client = $client;
     $self = $this;
     $client->connect()->then(function () use($self) {
         $self->applySubscriptions();
     });
 }
示例#2
0
 private function getConnectedClient(InputStreamInterface $input, OutputStreamInterface $output)
 {
     $client = new Client($input, $output, array('vhost' => 'localhost'));
     $client->connect();
     $input->emit('frame', array(new Frame('CONNECTED')));
     return $client;
 }