20#ifndef ORES_EVENTING_SERVICE_REGISTRAR_HPP
21#define ORES_EVENTING_SERVICE_REGISTRAR_HPP
23#include "ores.logging/make_logger.hpp"
24#include "ores.eventing/domain/event_traits.hpp"
25#include "ores.eventing/service/postgres_event_source.hpp"
26#include "ores.eventing/service/event_channel_registry.hpp"
45 [[nodiscard]]
static auto& lg() {
47 static auto instance = make_logger(
"ores.eventing.service.registrar");
60 template<
typename Event>
62 const std::string& entity_name,
63 const std::string& channel_name) {
64 BOOST_LOG_SEV(lg(), logging::info)
65 <<
"Registering event mapping: " << entity_name
66 <<
" -> " << channel_name;
83 template<domain::has_event_traits Event>
85 const std::string& entity_name,
86 const std::string& channel_name,
88 const std::string& description) {
89 BOOST_LOG_SEV(lg(), logging::info)
90 <<
"Registering event mapping: " << entity_name
91 <<
" -> " << channel_name;
Event bus and related services.
Definition event_bus.hpp:33
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Registry of available event channels.
Definition event_channel_registry.hpp:54
void register_channel(const std::string &description)
Register a channel for a typed event.
Definition event_channel_registry.hpp:73
Event source that bridges PostgreSQL LISTEN/NOTIFY to the event bus.
Definition postgres_event_source.hpp:57
void register_mapping(const std::string &entity_name, const std::string &channel_name)
Register a mapping from entity name to typed domain event.
Definition postgres_event_source.hpp:106
Helper class for registering entity-to-event mappings.
Definition registrar.hpp:43
static void register_mapping(postgres_event_source &source, const std::string &entity_name, const std::string &channel_name)
Register a single entity-to-event mapping.
Definition registrar.hpp:61
static void register_mapping(postgres_event_source &source, const std::string &entity_name, const std::string &channel_name, event_channel_registry ®istry, const std::string &description)
Register a single entity-to-event mapping with channel registry.
Definition registrar.hpp:84