Refactoring, logging improvements

This commit is contained in:
2024-03-12 02:21:42 +01:00
parent 69fd46b73a
commit e10fd6c471
10 changed files with 38 additions and 16 deletions

View File

@ -54,8 +54,13 @@ class Server
$this->config = $config;
$this->logger = $logger ?? new NullLogger();
if ($logger instanceof Logger) {
$topicLogger = $logger->withName("broker");
} else {
$topicLogger = $this->logger;
}
$this->topicManager = new TopicManager();
$this->topicManager = new TopicManager($topicLogger);
$this->loop->addPeriodicTimer(30, function () {
$this->topicManager->garbageCollect();
});