1: <?php
2:
3: namespace Budabot\Core;
4:
5: class EventLoop {
6:
7:
8: public $chatBot;
9:
10:
11: public $eventManager;
12:
13:
14: public $socketManager;
15:
16:
17: public $timer;
18:
19: public function execSingleLoop() {
20: $this->chatBot->processAllPackets();
21:
22: if ($this->chatBot->isReady()) {
23: $this->socketManager->checkMonitoredSockets();
24: $this->eventManager->executeConnectEvents();
25: $this->timer->executeTimerEvents();
26: $this->eventManager->crons();
27:
28: usleep(10000);
29: }
30: }
31: }
32: