Commit graph

15 commits

Author SHA1 Message Date
Arne Welzel
a90a41a8b5 cluster: Add Backend::SetNodeId() 2025-04-23 14:27:43 +02:00
Arne Welzel
3d3b7a0759 cluster/Backend: Add ProcessError()
Allow backends to pass errors to a strategy. Locally, these raise
Cluster::Backend::error() events that are logged to the reporter
as errors.
2025-04-23 14:19:08 +02:00
Arne Welzel
fcc0f45c57 cluster/Backend: Rename EnqueueLocalEvent() to ProcessLocalEvent() 2025-04-23 14:19:08 +02:00
Arne Welzel
f8ef5addaa cluster/Backend: Rename HandleRemoteEvent() to ProcessEvent()
...also add Backend::ProcessEvent() for backends to trigger event
processing without needing to use ProcessEventMessage().
2025-04-23 14:19:08 +02:00
Tim Wojtulewicz
1169fcf2a2 Move byte_buffer types from cluster and storage into util 2025-04-14 10:11:13 -07:00
Arne Welzel
3946856f06 cluster/Backend: Add name and lookup component tag
This adds two new accessors on Backend, Name() and Tag() that can
be used for introspection of a Backend instance.
2025-04-11 10:01:30 +02:00
Arne Welzel
214629e054 cluster/Event: Hide members behind accessors 2025-04-11 09:58:07 +02:00
Arne Welzel
90f94ff4f2 cluster/PublishEvent:: Make event non-const
We want to introduce a hook that can modify the cluster event instances, so
need to pass around a non-const version of it.
2025-04-11 09:58:07 +02:00
Arne Welzel
09ccb2e250 cluster/Backend: Queue a single message only
The ZeroMQ backend would accumulate multiple messages and enqueue them
all at once. However, as this could potentially result in huge batches
of events being queued into the event loop at once, switch to a one
message at a time model. If there's too many messages queued already,
OnLoop::QueueForProcessing() will block the ZeroMQ thread until
there's room available again.
2025-03-10 17:07:30 +01:00
Arne Welzel
23405194a0 cluster/ThreadedBackend: Switch to OnLoopProcess 2025-03-10 17:07:30 +01:00
Arne Welzel
e8f87019c6 cluster: Add SubscribeCallback support
This allows callers of Subscribe() to pass in a callback that will be invoked
once the subscription is established or failed to establish. It is the
backend's responsibility to execute the callback on the main thread either
synchronously, or preferably asynchronously at a later point, by
scheduling a task on the IO main loop.

This turns on ZMQ_XPUB_VERBOSE for ZeroMQ so that notifications about
subscriptions are raised even if the subscriptions has previously been
observed.
2025-02-05 10:39:56 +01:00
Arne Welzel
769044e8e1 cluster/Backend: Pass node_id via Init() 2025-02-05 10:39:56 +01:00
Arne Welzel
0b7a660a34 cluster/Backend: Make backend event processing customizable
This allows configurability at the code level to decide what to do with
a received remote events and events produced by a backend. For now, only
enqueue events into the process's script layer, but for the WebSocket
interface, the action would be to send out the event on a WebSocket
connection instead.
2025-02-05 10:39:56 +01:00
Arne Welzel
9b2fff9640 cluster/Backend: Do not use const std::string_view& 2025-02-05 10:39:56 +01:00
Arne Welzel
fb23a06f6f cluster/Backend: Interface for cluster backends 2024-11-22 10:43:50 +01:00