public function notifyNowPlaying(SSLTrack $track = null)
 {
     if ($track) {
         $this->track_to_notify = $track;
         // Send tweet in a new process, so that it doesn't block other plugins.
         $runner = new ParallelRunner();
         $runner->spinOff($this, 'Twitter update');
         unset($this->track_to_notify);
     }
 }
示例#2
0
 public function notifyTick($seconds)
 {
     do {
         // handle all pending requests in parallel
         $conn = @socket_accept($this->socket);
         if ($conn !== false) {
             $this->most_recent_accepted_connection = $conn;
             $runner = new ParallelRunner();
             $runner->spinOff($this, 'JSON Request');
             unset($this->most_recent_accepted_connection);
         }
     } while ($conn !== false);
 }