morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::exec::IoLoop::Weak Class Reference

A non-owning handle that posts to the loop only while it exists. More...

#include <io_loop.hpp>

Public Member Functions

template<class F>
bool post (F &&task) const
 Posts task if the loop still exists.

Detailed Description

A non-owning handle that posts to the loop only while it exists.

For a callback that another executor runs and that may outlive the component that armed it — a RemoteServer reply arriving on a pool thread after its transport has gone.

Definition at line 91 of file io_loop.hpp.

Member Function Documentation

◆ post()

template<class F>
bool morph::exec::IoLoop::Weak::post ( F && task) const
inline

Posts task if the loop still exists.

Template Parameters
FA copyable callable taking no arguments.
Parameters
taskWhat to run on the loop thread.
Returns
false if the loop is gone and task was dropped.

Definition at line 98 of file io_loop.hpp.


The documentation for this class was generated from the following file: