holoscan::InMemoryPubSubSession
holoscan::InMemoryPubSubSession
Process-global shared state for a group of in-memory pub/sub participants.
InMemoryPubSubSession consolidates the SharedInMemoryPubSubBackend and SharedInMemoryPubSubSession into a single, reusable class. It owns a shared InMemoryDiscovery and InMemoryTransport, and provides per-participant discovery/transport frontends that multiplex callbacks so that each PubSubContext’s init_context() wiring is independent. This was implemented to enable test cases that involve launching multiple GXF contexts from the same process.
Inherits from: std::enable_shared_from_this< InMemoryPubSubSession > (public)
Constructors
InMemoryPubSubSession
Destructor
~InMemoryPubSubSession
Methods
create_frontends
join
Join this session from a specific GXF context.
leave
Leave this session from a specific GXF context.
is_multi_context
Returns true if more than one distinct GXF context has joined.
session_id
ensure_backends
retain_participant
release_participant
replay_existing_publishers
replay_existing_subscribers
announce_publisher
announce_subscriber
remove_publisher
remove_subscriber
query_publishers
query_subscribers
get_all_topics
wait_for_subscribers
send
Const (1)
Const (2)
send_queue_size
discovery
transport
snapshot_participants
cleanup_expired_participants_locked
reset_locked
notify_publisher_discovered
notify_subscriber_discovered
notify_publisher_lost
notify_subscriber_lost
make_receive_callback
registry
Static methods
get_or_create
Get or create a session by ID.
Thread-safe. Returns the same shared_ptr for the same session_id within the process.
reset_all_for_testing
Release all sessions and reset shared state for tests.
Must only be called when no session frontends are active.
Member variables
Inner classes
Frontends
Create a paired discovery + transport frontend that share the same participant state.
The discovery and transport frontends must be used together for a single PubSubContext — they share per-participant callback state so that PubSubContext::init_context() wiring is independent per context.