Пример #1
0
 public function enqueueSelf()
 {
     $class_name = get_class($this);
     $task = new FindNode($this->settings, $this->key_id);
     $task->enqueue()->done([$this, 'perform']);
     return $this;
 }
Пример #2
0
 public function fillBuckets()
 {
     for ($i = 0; $i < N / 8; $i += 4) {
         $j = 0;
         #      for($j = 0; $j < 8; $j++) {
         $node_id = $this->settings->own_node_id;
         $byte = $node_id[$i] ^ chr(1 << $j);
         $node_id[$i] = $byte;
         $task = new FindNode($this->settings, $node_id);
         $task->enqueue();
         #      }
     }
 }