Own the event bus in Core; inject it into MusicManager
Core holds a Void::EventBus::EventBus (Async), provides it as a service, and runs its 18 event subscriptions against it directly (setupEventBusSubscriptions is no longer const since it now mutates the owned bus). MusicManager gets the bus via setEventBus() and publishes through a small emit<T>() helper (14 former GlobalEventBus publish sites). Delete EventBus.cpp (the singleton definition). Build green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
9d56a6ff01
commit
f7553d10d3
5 files changed
+63
-57
No files matched your search
@@ -7,6 +7,7 @@
|
||||
#include "RpcServer.hpp"
|
||||
#include <ConfigTypes.hpp>
|
||||
#include <CoreInterface.hpp>
|
||||
#include <Void/Async/EventBus.hpp>
|
||||
#include <Database.hpp>
|
||||
#include <RpcTypes.hpp>
|
||||
#include <StateBlob.hpp>
|
||||
@@ -150,7 +151,7 @@ namespace Echoion::Core
|
||||
[[nodiscard]] bool isAdmin(uint64_t clientId) const;
|
||||
void updateWhisperList();
|
||||
void setupRpcHandlers();
|
||||
void setupEventBusSubscriptions() const noexcept;
|
||||
void setupEventBusSubscriptions() noexcept;
|
||||
|
||||
// Components
|
||||
std::shared_ptr<NetworkClient> networkClient_;
|
||||
@@ -186,6 +187,11 @@ namespace Echoion::Core
|
||||
// shims over the same instances.
|
||||
Void::Service::ServiceRegistry registry_;
|
||||
|
||||
// Application event bus (async): playback/queue/subscription events
|
||||
// published by MusicManager and consumed here for RPC broadcast +
|
||||
// DB persistence. Owned by Core, provided as a service.
|
||||
Void::EventBus::EventBus eventBus_{Void::EventBus::Mode::Async};
|
||||
|
||||
public:
|
||||
|
||||
// Access the service registry (composition root).
|
||||
|
||||
Reference in new issue
Block a user