|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
Envelope kinds a RemoteServer answers through an extension, such as the UI service's ui-* kinds. More...
#include <remote.hpp>
Public Member Functions | |
| IEnvelopeService (const IEnvelopeService &)=delete | |
| IEnvelopeService & | operator= (const IEnvelopeService &)=delete |
| IEnvelopeService (IEnvelopeService &&)=delete | |
| IEnvelopeService & | operator= (IEnvelopeService &&)=delete |
| virtual bool | serves (std::string_view kind) const =0 |
Whether this service answers kind. | |
| virtual std::string | handle (const ::morph::wire::Envelope &request, const ::morph::session::IAuthorizer &authorizer)=0 |
| Answers one envelope of a kind serves accepted. | |
| virtual std::string | handle (const ::morph::wire::Envelope &request, const ::morph::session::IAuthorizer &authorizer, ConnectionFacts &facts) |
| Answers one envelope of a kind serves accepted, with the facts of the connection it arrived on. | |
Envelope kinds a RemoteServer answers through an extension, such as the UI service's ui-* kinds.
Core does not know the kinds a higher layer adds, and must not include that layer. A server consults its services only for a kind it does not answer itself, so a service cannot take over execute, hello or any other built-in kind; a kind no service serves is still answered err "unknown envelope kind: <kind>". See docs/spec/core/backend.md, "Envelope services".
Definition at line 231 of file remote.hpp.
|
nodiscardpure virtual |
Whether this service answers kind.
| kind | The envelope's kind. |
Implemented in morph::ui::UiService.
|
nodiscardpure virtual |
Answers one envelope of a kind serves accepted.
Runs on the server strand, so it must not block. The server has already stamped the verified principal onto request.session (the client's claim is never seen here); authorising the request is the service's, through authorizer. A throw becomes an err reply carrying its message.
| request | The decoded envelope. |
| authorizer | The server's authoriser. |
Implemented in morph::ui::UiService.
|
inlinenodiscardvirtual |
Answers one envelope of a kind serves accepted, with the facts of the connection it arrived on.
What the server calls. A service that learns something about the connection, as the UI service learns that ui-hello negotiated events, overrides this one and records it in facts; the default forwards to the two-parameter handle and leaves facts alone. A service overriding only one of the two adds using IEnvelopeService::handle;, so the other is not hidden. Same thread and error rules as the two-parameter handle.
| request | The decoded envelope. |
| authorizer | The server's authoriser. |
| facts | The connection's facts, which the service may set; fresh ones for a message handled without a connection. |
Reimplemented in morph::ui::UiService.
Definition at line 275 of file remote.hpp.