Author: Abed Halawi (abed.halawi@vinelab.com)
Inheritance: extends Thruway\Peer\Client
Ejemplo n.º 1
0
 public function test_on_session_start_boots_providers()
 {
     $called = [];
     $bootMe = function ($client) use(&$called) {
         $called['bootMe'] = $client;
     };
     $andMe = function ($client) use(&$called) {
         $called['andMe'] = $client;
     };
     $providers = ['ClientTestProviderStub', $bootMe, $andMe];
     $c = new Client('cirrus.minor', $providers);
     $c->onSessionStart('session', 'transport');
     $this->assertArrayHasKey('bootMe', $called);
     $this->assertInstanceOf('Vinelab\\Minion\\Client', $called['bootMe']);
     $this->assertArrayHasKey('andMe', $called);
     $this->assertInstanceOf('Vinelab\\Minion\\Client', $called['andMe']);
 }
Ejemplo n.º 2
0
 /**
  * Constructor.
  *
  * @param \Vinelab\Minion\Client $client
  */
 public function __construct($client)
 {
     $client->setDelegateProvider($this);
     $client->setTopicPrefix($this->prefix);
     $this->setClient($client);
 }