Beispiel #1
0
 public function onCompletion(Server $server)
 {
     if ($this->hasResult()) {
         PocketTelegram::debug("Result: " . $this->getResult());
         if (!is_null($this->callback)) {
             call_user_func($this->callback, $this->getResult());
         }
     }
 }
 /**
  * @param string $method
  * @param array $params
  * @param callable $callback
  */
 public static function request($method, $params, $callback = null)
 {
     PocketTelegram::debug("Requesting " . $method . " - " . json_encode($params));
     Server::getInstance()->getScheduler()->scheduleAsyncTask(new RequestTask(PocketTelegram::getBaseURL() . $method, $params, $callback));
 }