| 590 | } |
| 591 | |
| 592 | SessionManager::ParserBinding SessionManager::parserBindingForObjectTopic(ObjectTopicId id) const { |
| 593 | std::shared_lock lock(object_parsers_mutex_); |
| 594 | const auto* slot = findValidParserSlotLocked(id); |
| 595 | if (slot == nullptr) { |
| 596 | return {}; |
| 597 | } |
| 598 | // Copy the shared_ptrs out under the lock so the snapshot keeps the parser |
| 599 | // alive even if the streaming worker replaces the slot right after we release. |
| 600 | return ParserBinding{ |
| 601 | static_cast<MessageParserPluginBase*>(slot->handle->context()), |
| 602 | slot->mutex, |
| 603 | slot->handle, |
| 604 | }; |
| 605 | } |
| 606 | |
| 607 | std::shared_ptr<void> SessionManager::parserKeepaliveForObjectTopic(ObjectTopicId id) const { |
| 608 | // shared_ptr<MessageParserHandle> -> shared_ptr<void>: holding it keeps the |
no outgoing calls