|
ORE Studio 0.0.4
|
Manages commands related to event subscriptions and notifications. More...
#include <subscription_commands.hpp>

Static Public Member Functions | |
| static void | register_commands (cli::Menu &root, comms::net::client_session &session) |
| Register subscription management commands. | |
| static void | process_channels (std::ostream &out, comms::net::client_session &session) |
| List available event channels. | |
| static void | process_listen (std::ostream &out, comms::net::client_session &session, std::string event_type) |
| Process a listen (subscribe) request. | |
| static void | process_unlisten (std::ostream &out, comms::net::client_session &session, std::string event_type) |
| Process an unlisten (unsubscribe) request. | |
| static void | process_subscriptions (std::ostream &out, comms::net::client_session &session) |
| Display current subscriptions. | |
| static void | process_notifications (std::ostream &out, comms::net::client_session &session) |
| Display and clear pending notifications. | |
| static std::size_t | display_pending_notifications (std::ostream &out, comms::net::client_session &session) |
| Display pending notifications without clearing them. | |
Manages commands related to event subscriptions and notifications.
Creates an 'events' submenu with PSQL-like LISTEN/NOTIFY functionality:
|
static |
Register subscription management commands.
Creates an 'events' submenu and adds channels, listen, unlisten, subscriptions, and notifications commands to it.
| root | The root menu to add the events submenu to |
| session | Client session for server communication |
|
static |
List available event channels.
Queries the server for the list of available event channels that clients can subscribe to.
| out | Output stream for user feedback |
| session | Client session for server communication |

|
static |
Process a listen (subscribe) request.
| out | Output stream for user feedback |
| session | Client session for server communication |
| event_type | The event type to subscribe to |

|
static |
Process an unlisten (unsubscribe) request.
| out | Output stream for user feedback |
| session | Client session for server communication |
| event_type | The event type to unsubscribe from (empty = all) |

|
static |
Display current subscriptions.
| out | Output stream for user feedback |
| session | Client session for server communication |

|
static |
Display and clear pending notifications.
| out | Output stream for user feedback |
| session | Client session for server communication |

|
static |
Display pending notifications without clearing them.
Helper function that can be called after each command to show notifications like PSQL does.
| out | Output stream for user feedback |
| session | Client session for server communication |