Refactored subscribers to own namespace

This commit is contained in:
Chris 2024-03-14 00:32:44 +01:00
parent 952b13535d
commit 17c683d9e8
9 changed files with 13 additions and 8 deletions

View File

@ -40,9 +40,6 @@ Take a look at `src/Daemon.php` and `src/Http/Server.php` depending on how much
* [ ] WebSocket distributor
* [ ] WebSocket authentication
* [x] Setup subscriptions
* [x] Dynamic subscriptions
* [x] Distribute events over WS
* [ ] HTTP middleware unittests
* [ ] Replay missed events based on event id
* [ ] Metrics endpoint

View File

@ -1,7 +1,8 @@
<?php
namespace NoccyLabs\Mercureact\Broker;
namespace NoccyLabs\Mercureact\Broker\Subscriber;
use NoccyLabs\Mercureact\Broker\Message;
use NoccyLabs\SimpleJWT\JWTToken;
use Psr\Http\Message\ServerRequestInterface;
use React\Stream\WritableStreamInterface;

View File

@ -1,6 +1,8 @@
<?php
namespace NoccyLabs\Mercureact\Broker;
namespace NoccyLabs\Mercureact\Broker\Subscriber;
use NoccyLabs\Mercureact\Broker\Message;
interface SubscriberInterface
{

View File

@ -1,9 +1,11 @@
<?php
namespace NoccyLabs\Mercureact\Broker;
namespace NoccyLabs\Mercureact\Broker\Subscriber;
use Evenement\EventEmitterInterface;
use Evenement\EventEmitterTrait;
use NoccyLabs\Mercureact\Broker\Message;
use NoccyLabs\Mercureact\Broker\TopicManager;
use NoccyLabs\React\WebSocket\WebSocketConnection;
use NoccyLabs\SimpleJWT\JWTToken;
use Psr\Http\Message\ServerRequestInterface;

View File

@ -2,6 +2,7 @@
namespace NoccyLabs\Mercureact\Broker;
use NoccyLabs\Mercureact\Broker\Subscriber\SubscriberInterface;
use SplObjectStorage;
class Topic

View File

@ -2,6 +2,7 @@
namespace NoccyLabs\Mercureact\Broker;
use NoccyLabs\Mercureact\Broker\Subscriber\SubscriberInterface;
use Psr\Log\LoggerInterface;
use SplObjectStorage;

View File

@ -3,7 +3,7 @@
namespace NoccyLabs\Mercureact\Http\Middleware;
use NoccyLabs\Mercureact\Broker\Message;
use NoccyLabs\Mercureact\Broker\SseSubscriber;
use NoccyLabs\Mercureact\Broker\Subscriber\SseSubscriber;
use NoccyLabs\Mercureact\Broker\TopicManager;
use NoccyLabs\Mercureact\Configuration;
use NoccyLabs\Mercureact\Exception\RequestException;

View File

@ -3,7 +3,7 @@
namespace NoccyLabs\Mercureact\Http\Middleware;
use NoccyLabs\Mercureact\Broker\TopicManager;
use NoccyLabs\Mercureact\Broker\WsSubscriber;
use NoccyLabs\Mercureact\Broker\Subscriber\WsSubscriber;
use NoccyLabs\Mercureact\Configuration;
use NoccyLabs\React\WebSocket\WebSocketConnection;
use NoccyLabs\React\WebSocket\WebSocketMiddleware;

View File

@ -2,6 +2,7 @@
namespace NoccyLabs\Mercureact\Broker;
use NoccyLabs\Mercureact\Broker\Subscriber\SubscriberInterface;
use PHPUnit\Framework\Attributes\CoversClass;
#[CoversClass(Topic::class)]