Example #1
0
 public function quit()
 {
     $this->globalContainer->get('eventloop')->nextTick(function ($loop) {
         $this->server->quit();
         $this->globalContainer->quit();
         $loop->stop();
     });
 }
Example #2
0
 public function testChaining()
 {
     $parent = new Container();
     $a = new \stdClass();
     $b = new \stdClass();
     $parent->set('a', $a);
     $parent->set('b', $b);
     $child = new Container($parent);
     $bb = new \stdClass();
     $c = new \stdClass();
     $child->set('b', $bb);
     $child->set('c', $c);
     $this->assertSame($a, $parent->get('a'));
     $this->assertSame($b, $parent->get('b'));
     $this->assertSame($a, $child->get('a'));
     $this->assertSame($bb, $child->get('b'));
     $this->assertSame($c, $child->get('c'));
 }