> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sdk-user-guide/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sdk-user-guide/_mcp/server.

# holoscan::InMemorySessionParticipant

> Per-participant callback and GID tracking for a shared in-memory pub/sub session.

Per-participant callback and GID tracking for a shared in-memory pub/sub session.

Each [PubSubContext](../classes/pubsubcontext) that joins a session gets its own SessionParticipant, which stores the callbacks that PubSubContext::init\_context() registers on the discovery and transport frontends.

```cpp showLineNumbers={false}
#include <holoscan/in_memory_pubsub_session.hpp>
```

---

## Member variables

| Name                              | Type                                                          | Description |
| --------------------------------- | ------------------------------------------------------------- | ----------- |
| `mutex`                           | `std::mutex`                                                  |             |
| `discovery_active`                | `bool`                                                        |             |
| `transport_active`                | `bool`                                                        |             |
| `participant_closed`              | `bool`                                                        |             |
| `publisher_discovered_callback`   | `nvidia::gxf::PubSubDiscovery::PublisherDiscoveredCallback`   |             |
| `subscriber_discovered_callback`  | `nvidia::gxf::PubSubDiscovery::SubscriberDiscoveredCallback`  |             |
| `publisher_lost_callback`         | `nvidia::gxf::PubSubDiscovery::PublisherLostCallback`         |             |
| `subscriber_lost_callback`        | `nvidia::gxf::PubSubDiscovery::SubscriberLostCallback`        |             |
| `receive_callback`                | `nvidia::gxf::PubSubTransport::ReceiveCallback`               |             |
| `connection_established_callback` | `nvidia::gxf::PubSubTransport::ConnectionEstablishedCallback` |             |
| `connection_lost_callback`        | `nvidia::gxf::PubSubTransport::ConnectionLostCallback`        |             |
| `publisher_gids`                  | `std::unordered_set< nvidia::gxf::PublisherGid >`             |             |
| `subscriber_gids`                 | `std::unordered_set< nvidia::gxf::SubscriberGid >`            |             |