|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
What a wire transport offers beside IBackend: one request, one reply, matched by callId. More...
#include <envelope_transport.hpp>
Public Member Functions | |
| IEnvelopeTransport (IEnvelopeTransport const &)=delete | |
| IEnvelopeTransport & | operator= (IEnvelopeTransport const &)=delete |
| IEnvelopeTransport (IEnvelopeTransport &&)=delete | |
| IEnvelopeTransport & | operator= (IEnvelopeTransport &&)=delete |
| virtual ::morph::async::Completion<::morph::wire::Envelope > | request (::morph::wire::Envelope envelope, ::morph::exec::IExecutor &cbExec)=0 |
| Sends one request envelope and settles with its reply. | |
What a wire transport offers beside IBackend: one request, one reply, matched by callId.
SocketBackend and QtWebSocketBackend implement it. A backend without a wire, such as LocalBackend, has no peer and does not.
Definition at line 21 of file envelope_transport.hpp.
|
pure virtual |
Sends one request envelope and settles with its reply.
The envelope travels with the session it carries: the transport assigns its callId and stamps nothing else, because a protocol that passes its session explicitly (ui::UiClient::open) must not have it replaced by the transport's default. The reply resolves the Completion whether it is ok or err, since reading an err is the caller's protocol; only a failure to deliver the request or its reply rejects it. A request made while the connection is down is held and sent at the next connect; cancelPending, a drop and the transport's destruction reject what is pending or held.
| envelope | The request. Its callId is replaced. |
| cbExec | Executor the answer is delivered on. Borrowed: it must outlive the returned Completion. |
Implemented in morph::net::SocketBackend, and morph::qt::QtWebSocketBackend.