Example #1
0
 public function enqueue(Action $action) : Promise
 {
     $key = $action->getRoom()->getIdentifier()->getIdentString();
     if (!isset($this->actionQueues[$key])) {
         $this->actionQueues[$key] = new Queue();
     }
     $this->actionQueues[$key]->push($action);
     if (empty($this->runningLoops[$key])) {
         resolve($this->executeActionsFromQueue($key));
     }
     return $action->promise();
 }
Example #2
0
 public function __construct(Logger $logger, HttpRequest $request, ChatRoom $room, PostedMessageTracker $tracker, string $text)
 {
     parent::__construct($logger, $request, $room);
     $this->tracker = $tracker;
     $this->text = $text;
 }