The owner of a signal graph: every node takes one, and every operation runs on its owner.
More...
|
| | Runtime (exec::IExecutor &owner, RuntimeOptions options={}) |
| | ~Runtime () |
| | Reports detail::site::kRuntimeOutlived when nodes made from it are still alive, then detaches the core, so a flush still posted does nothing.
|
|
| Runtime (Runtime const &)=delete |
|
Runtime & | operator= (Runtime const &)=delete |
|
| Runtime (Runtime &&)=delete |
|
Runtime & | operator= (Runtime &&)=delete |
| template<typename F> |
| decltype(auto) | batch (F &&fn) |
| | Runs fn as one batch: every write inside it is one flush.
|
| template<typename F> |
| decltype(auto) | widgetEvent (F &&fn) |
| | Runs a widget callback as one batch. A flush that falls due while it runs, or that a nested event loop inside it (a modal dialog) picks up, is deferred: the end of the outermost widget event posts it. So a remount never destroys a widget whose native handler is on the stack, and a nested loop does not spin on a flush it may not run. The callback is untracked, like untracked: a widget callback is a transition, so one dispatched from inside an Effect's run does not subscribe that Effect to what it reads.
|
| template<typename F> |
| decltype(auto) | untracked (F &&fn) const |
| | Runs fn with tracking off: reads inside it subscribe nothing.
|
| exec::IExecutor & | owner () const noexcept |
| | The owner executor.
|
| bool | isFlushRequested () const noexcept |
| | Whether a flush is posted and has not run yet.
|
| RuntimeStats | stats () const |
| | What the runtime has counted so far. Read it on the owner.
|
| std::shared_ptr< detail::RuntimeCore > const & | core () const noexcept |
| | The shared core every node holds.
|
The owner of a signal graph: every node takes one, and every operation runs on its owner.
Writes are batched. When the outermost batch ends with effects queued, the runtime posts one flush to the owner; no Effect ever runs inside set(). Destroying a Runtime while nodes made from it are alive is reported (detail::site::kRuntimeOutlived); the nodes stay valid and any flush does nothing.
Off the owner, batch, widgetEvent and untracked are reported (detail::site::kOffOwner) and refused: the body still runs, because the caller may need what it returns, but the runtime's state (batch depth, widget-event depth, tracking frame) is left alone, and each graph operation inside the body is checked, reported and refused on its own.
Definition at line 70 of file runtime.hpp.
template<typename F>
| decltype(auto) morph::reactive::Runtime::widgetEvent |
( |
F && | fn | ) |
|
|
inline |
Runs a widget callback as one batch. A flush that falls due while it runs, or that a nested event loop inside it (a modal dialog) picks up, is deferred: the end of the outermost widget event posts it. So a remount never destroys a widget whose native handler is on the stack, and a nested loop does not spin on a flush it may not run. The callback is untracked, like untracked: a widget callback is a transition, so one dispatched from inside an Effect's run does not subscribe that Effect to what it reads.
- Template Parameters
-
| F | A callable taking no arguments. |
- Parameters
-
- Returns
- Whatever
fn returns.
Definition at line 122 of file runtime.hpp.