|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
#include <cassert>#include <core/async/ExecutorContext.hpp>#include <core/net/EventLoop.hpp>#include <core/net/PlatformLoop.hpp>#include <cstdint>#include <exception>#include <future>#include <memory>#include <type_traits>#include <utility>#include "executor.hpp"#include "logger.hpp"#include "profiler.hpp"#include <thread>Go to the source code of this file.
Classes | |
| class | morph::exec::IoLoop |
| Owns a core::net::PlatformLoop and, for IoLoopDriver::OwnThread natively, the one thread that runs it. More... | |
| class | morph::exec::IoLoop::Weak |
| A non-owning handle that posts to the loop only while it exists. More... | |
Enumerations | |
| enum class | morph::exec::IoLoopDriver : std::uint8_t { OwnThread , Caller } |
| Who turns an IoLoop. More... | |
IoLoop — the one I/O loop an application runs, and the owner of every socket, timer and probe built on it.
morph::net::SocketBackend, morph::net::SocketServer, TimeoutScheduler and offline::NetworkMonitor own no thread. Each keeps its state on a core::net::PlatformLoop and touches it only in tasks that loop runs; its public verbs post to the loop and return. An application constructs one IoLoop and hands it to every one of them, so one thread carries every connection, every deadline and the connectivity probe.
Definition in file io_loop.hpp.
|
strong |
Who turns an IoLoop.
| Enumerator | |
|---|---|
| OwnThread | The IoLoop starts one thread that runs the loop until it is destroyed. |
| Caller | No thread is started: the constructing thread turns the loop, and is the loop's between turns as well as inside them. No other thread may turn it; a debug build asserts when a task posted to it runs on another. |
Definition at line 52 of file io_loop.hpp.