Example #1
0
 /**
  * Create a new threader, 'thread last' by default in root namespace
  *
  * @return Thread
  */
 public static function create($context)
 {
     $thread = new Thread($context);
     return $thread->threadLast()->inNamespace('');
 }
Example #2
0
 public function testThreadingNthArgument()
 {
     $res = Thread::create(array(1, 2, 3))->threadNth(2)->array_map($this->inc)->threadNth(1)->array_filter($this->odd)->value();
     $this->assertEquals(array(3), array_values($res));
 }