|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
Declarative control: Query, Mutation and Subscription turn server interaction into reactive state, so a controller states what it depends on and what a write invalidates instead of sequencing calls by hand. More...
#include <chrono>#include <cstddef>#include <cstdint>#include <exception>#include <functional>#include <map>#include <memory>#include <optional>#include <stdexcept>#include <string>#include <utility>#include <vector>#include "../attributes.hpp"#include "../core/bridge.hpp"#include "../core/callback_scope.hpp"#include "../core/completion.hpp"#include "../core/registry.hpp"#include "detail/graph.hpp"#include "runtime.hpp"#include "scheduler.hpp"#include "signal.hpp"Go to the source code of this file.
Classes | |
| class | morph::reactive::Refetchable |
| Something a Mutation can tell to fetch again after it succeeds. More... | |
| class | morph::reactive::InvalidationLink |
| A query's registration with the mutations that invalidate it. More... | |
| struct | morph::reactive::QueryOptions |
| How a Query refreshes besides key changes, and how long it lets a key settle. More... | |
| class | morph::reactive::Query< A, R > |
| A derived async resource: the result of fetching whatever its tracked key names. More... | |
| struct | morph::reactive::MutationOptions< A > |
| How a Mutation sequences its runs, and what a success invalidates. More... | |
| class | morph::reactive::Mutation< A, R > |
| A command: issues a write and tracks it, then refetches what the write invalidates. More... | |
| class | morph::reactive::Subscription< R > |
| The latest R the bridge published on a handler's instance, as reactive state. More... | |
Enumerations | |
| enum class | morph::reactive::Concurrency : std::uint8_t { Exclusive , Serial , Latest , Parallel } |
| What a Mutation does with a run while another is in flight. More... | |
Functions | |
| std::string | morph::reactive::errorMessage (std::exception_ptr const &error) |
| The one place an exception_ptr becomes display text. | |
| template<typename M, typename S> | |
| void | morph::reactive::detail::checkHandlerExecutor (Runtime const &runtime, bridge::BridgeHandler< M, S > const &handler) |
Checks that handler delivers its callbacks on runtime's owner, reporting site::kHandlerExecutor when it does not. | |
Declarative control: Query, Mutation and Subscription turn server interaction into reactive state, so a controller states what it depends on and what a write invalidates instead of sequencing calls by hand.
Specified in docs/spec/reactive/control.md.
Definition in file control.hpp.
|
strong |
What a Mutation does with a run while another is in flight.
| Enumerator | |
|---|---|
| Exclusive | Refuses the run: run() returns false and nothing is sent. The default: a second click on a pending button does nothing. |
| Serial | Queues the run and sends it when the previous one settles, a failure included; one queue per MutationOptions::serialKey. |
| Latest | Sends the run; only the newest run's reply is applied. |
| Parallel | Sends the run; every reply is applied as it arrives. |
Definition at line 444 of file control.hpp.
|
inlinenodiscard |
The one place an exception_ptr becomes display text.
| error | The captured exception, or null. |
Definition at line 39 of file control.hpp.
| void morph::reactive::detail::checkHandlerExecutor | ( | Runtime const & | runtime, |
| bridge::BridgeHandler< M, S > const & | handler ) |
Checks that handler delivers its callbacks on runtime's owner, reporting site::kHandlerExecutor when it does not.
A control node writes its signals from the handler's callbacks, so they must run where the runtime runs. The check is by affinity, not by pointer identity: a distinct serial executor that runs its tasks on the owner's thread is accepted. An executor that is not serial is reported at once. Any other serial executor is checked where it runs, by one posted task, which reports when it finds itself off the owner. No callback executor means the bridge's owner.
| M | The handler's model type. |
| S | The handler's sharing policy. |
| runtime | The runtime the node belongs to. |
| handler | The handler the node is built over. |
Definition at line 109 of file control.hpp.