Author: Abed Halawi (abed.halawi@vinelab.com)
Inheritance: extends Thruway\Peer\Client
コード例 #1
0
ファイル: ClientTest.php プロジェクト: vinelab/minion
 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']);
 }
コード例 #2
0
ファイル: Provider.php プロジェクト: pacho104/redbpim
 /**
  * Constructor.
  *
  * @param \Vinelab\Minion\Client $client
  */
 public function __construct($client)
 {
     $client->setDelegateProvider($this);
     $client->setTopicPrefix($this->prefix);
     $this->setClient($client);
 }