|
LLVM
7.0.0
|
Contains primitive utilities for defining, calling and handling calls to remote procedures. More...
#include "llvm/ExecutionEngine/Orc/RPCUtils.h"
Classes | |
| class | CanDeserializeCheck |
| class | CanSerializeCheck |
| class | OrcRPCInvalid |
| class | OrcRPCNegotiate |
| class | OrcRPCResponse |
Public Member Functions | |
| RPCEndpointBase (ChannelT &C, bool LazyAutoNegotiation) | |
| Construct an RPC instance on a channel. More... | |
| template<typename Func > | |
| Error | negotiateFunction (bool Retry=false) |
| Negotiate a function id for Func with the other end of the channel. More... | |
| template<typename Func , typename HandlerT , typename... ArgTs> | |
| Error | appendCallAsync (HandlerT Handler, const ArgTs &... Args) |
| Append a call Func, does not call send on the channel. More... | |
| Error | sendAppendedCalls () |
| template<typename Func , typename HandlerT , typename... ArgTs> | |
| Error | callAsync (HandlerT Handler, const ArgTs &... Args) |
| Error | handleOne () |
| Handle one incoming call. More... | |
| void | abandonPendingResponses () |
| Abandon all outstanding result handlers. More... | |
| template<typename Func > | |
| void | removeHandler () |
| Remove the handler for the given function. More... | |
| void | clearHandlers () |
| Clear all handlers. More... | |
Static Public Member Functions | |
| template<typename... ArgTs> | |
| **static detail::ReadArgs< ArgTs... > | readArgs (ArgTs &... Args) |
| Helper for handling setter procedures - this method returns a functor that sets the variables referred to by Args... More... | |
Protected Types | |
| using | WrappedHandlerFn = std::function< Error(ChannelT &, SequenceNumberT)> |
Protected Member Functions | |
| FunctionIdT | getInvalidFunctionId () const |
| template<typename Func , typename HandlerT > | |
| void | addHandlerImpl (HandlerT Handler) |
| Add the given handler to the handler map and make it available for autonegotiation and execution. More... | |
| template<typename Func , typename HandlerT > | |
| void | addAsyncHandlerImpl (HandlerT Handler) |
| Error | handleResponse (SequenceNumberT SeqNo) |
| FunctionIdT | handleNegotiate (const std::string &Name) |
| template<typename Func > | |
| Expected< FunctionIdT > | getRemoteFunctionId (bool NegotiateIfNotInMap, bool NegotiateIfInvalid) |
| template<typename Func , typename HandlerT > | |
| WrappedHandlerFn | wrapHandler (HandlerT Handler) |
| template<typename Func , typename HandlerT > | |
| WrappedHandlerFn | wrapAsyncHandler (HandlerT Handler) |
Protected Attributes | |
| ChannelT & | C |
| bool | LazyAutoNegotiation |
| RPCFunctionIdAllocator< FunctionIdT > | FnIdAllocator |
| FunctionIdT | ResponseId |
| std::map< std::string, FunctionIdT > | LocalFunctionIds |
| std::map< const char *, FunctionIdT > | RemoteFunctionIds |
| std::map< FunctionIdT, WrappedHandlerFn > | Handlers |
| std::mutex | ResponsesMutex |
| detail::SequenceNumberManager< SequenceNumberT > | SequenceNumberMgr |
| std::map< SequenceNumberT, std::unique_ptr< detail::ResponseHandler< ChannelT > > > | PendingResponses |
Contains primitive utilities for defining, calling and handling calls to remote procedures.
ChannelT is a bidirectional stream conforming to the RPCChannel interface (see RPCChannel.h), FunctionIdT is a procedure identifier type that must be serializable on ChannelT, and SequenceNumberT is an integral type that will be used to number in-flight function calls.
These utilities support the construction of very primitive RPC utilities. Their intent is to ensure correct serialization and deserialization of procedure arguments, and to keep the client and server's view of the API in sync.
Definition at line 1006 of file RPCUtils.h.
|
protected |
Definition at line 1326 of file RPCUtils.h.
|
inline |
Construct an RPC instance on a channel.
Definition at line 1051 of file RPCUtils.h.
|
inline |
Abandon all outstanding result handlers.
This will call all currently registered result handlers to receive an "abandoned" error as their argument. This is used internally by the RPC in error situations, but can also be called directly by clients who are disconnecting from the remote and don't or can't expect responses to their outstanding calls. (Especially for outstanding blocking calls, calling this function may be necessary to avoid dead threads).
Definition at line 1187 of file RPCUtils.h.
|
inlineprotected |
Definition at line 1237 of file RPCUtils.h.
|
inlineprotected |
Add the given handler to the handler map and make it available for autonegotiation and execution.
Definition at line 1224 of file RPCUtils.h.
|
inline |
Append a call Func, does not call send on the channel.
The first argument specifies a user-defined handler to be run when the function returns. The handler should take an Expected<Func::ReturnType>, or an Error (if Func::ReturnType is void). The handler will be called with an error if the return value is abandoned due to a channel error.
Definition at line 1077 of file RPCUtils.h.
|
inline |
Definition at line 1136 of file RPCUtils.h.
|
inline |
Clear all handlers.
Definition at line 1211 of file RPCUtils.h.
|
inlineprotected |
Definition at line 1217 of file RPCUtils.h.
|
inlineprotected |
Definition at line 1293 of file RPCUtils.h.
|
inlineprotected |
Definition at line 1284 of file RPCUtils.h.
|
inline |
Handle one incoming call.
Definition at line 1143 of file RPCUtils.h.
|
inlineprotected |
Definition at line 1251 of file RPCUtils.h.
|
inline |
Negotiate a function id for Func with the other end of the channel.
Definition at line 1067 of file RPCUtils.h.
|
inlinestatic |
Helper for handling setter procedures - this method returns a functor that sets the variables referred to by Args...
to values deserialized from the channel. E.g.
typedef Function<0, bool, int> Func1;
... bool B; int I; if (auto Err = expect<Func1>(Channel, readArgs(B, I))) /* Handle Args
Definition at line 1175 of file RPCUtils.h.
|
inline |
Remove the handler for the given function.
A handler must currently be registered for this function.
Definition at line 1200 of file RPCUtils.h.
|
inline |
Definition at line 1133 of file RPCUtils.h.
|
inlineprotected |
Definition at line 1364 of file RPCUtils.h.
|
inlineprotected |
Definition at line 1331 of file RPCUtils.h.
|
protected |
Definition at line 1400 of file RPCUtils.h.
|
protected |
Definition at line 1404 of file RPCUtils.h.
|
protected |
Definition at line 1410 of file RPCUtils.h.
|
protected |
Definition at line 1402 of file RPCUtils.h.
|
protected |
Definition at line 1407 of file RPCUtils.h.
|
protected |
Definition at line 1415 of file RPCUtils.h.
|
protected |
Definition at line 1408 of file RPCUtils.h.
|
protected |
Definition at line 1406 of file RPCUtils.h.
|
protected |
Definition at line 1412 of file RPCUtils.h.
|
protected |
Definition at line 1413 of file RPCUtils.h.
1.8.13