Subscription enumeration, tweaks

This commit is contained in:
2024-03-11 14:39:58 +01:00
parent 2747b59abc
commit 8cbd12ee61
6 changed files with 76 additions and 23 deletions

View File

@ -14,6 +14,8 @@ class Topic
/** @var array<string,Message> */
private array $messages = [];
private ?string $lastEventId = null;
/** @var int Creation unixtime */
private int $created;
@ -69,6 +71,21 @@ class Topic
$this->subscribers->detach($subscriber);
}
public function getSubscribers(): array
{
return iterator_to_array($this->subscribers);
}
public function getTopic(): string
{
return $this->topic;
}
public function getLastEventId(): ?string
{
return $this->lastEventId;
}
/**
* Garbage collect histry
*