MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ stop()

void MayaFlux::Core::NetworkSubsystem::stop ( )
overridevirtual

Stop the subsystem's processing/event loops.

Implements MayaFlux::Core::ISubsystem.

Definition at line 136 of file NetworkSubsystem.cpp.

137{
138 if (!m_running.load()) {
139 return;
140 }
141
142 m_running.store(false);
143
144 {
145 std::shared_lock lock(m_backends_mutex);
146 for (auto& [transport, backend] : m_backends) {
147 backend->stop();
148 }
149 }
150
153 }
154
155 m_work_guard.reset();
156 m_io_context->stop();
157
158#if MAYAFLUX_USE_JTHREAD
159 if (m_io_thread.joinable()) {
160 m_io_thread.request_stop();
161 m_io_thread.join();
162 }
163#else
164 m_io_stop_requested.store(true);
165 if (m_io_thread.joinable()) {
166 m_io_thread.join();
167 }
168#endif
169
170 m_io_context->restart();
171
173 "Network Subsystem stopped");
174}
#define MF_INFO(comp, ctx,...)
std::unique_ptr< asio::io_context > m_io_context
std::unique_ptr< asio::executor_work_guard< asio::io_context::executor_type > > m_work_guard
std::unordered_map< NetworkTransport, std::unique_ptr< INetworkBackend > > m_backends
@ Shutdown
Engine/subsystem shutdown and cleanup.
@ Core
Core engine, backend, subsystems.
void stop()
Stop active Portal::Network operations.
Definition Network.cpp:36
bool is_initialized()
Return true if Portal::Network has been initialized.
Definition Network.cpp:66

References MayaFlux::Journal::Core, MayaFlux::Portal::Network::is_initialized(), MF_INFO, MayaFlux::Journal::Shutdown, and MayaFlux::Portal::Network::stop().

+ Here is the call graph for this function: