|
LLVM
10.0.0
|
Contains primitive utilities for defining, calling and handling calls to remote procedures. More...
#include "llvm/ExecutionEngine/Orc/RPC/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 941 of file RPCUtils.h.
|
protected |
Definition at line 1261 of file RPCUtils.h.
|
inline |
Construct an RPC instance on a channel.
Definition at line 986 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 1122 of file RPCUtils.h.
|
inlineprotected |
Definition at line 1172 of file RPCUtils.h.
|
inlineprotected |
Add the given handler to the handler map and make it available for autonegotiation and execution.
Definition at line 1159 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 1012 of file RPCUtils.h.
|
inline |
Definition at line 1071 of file RPCUtils.h.
|
inline |
Clear all handlers.
Definition at line 1146 of file RPCUtils.h.
|
inlineprotected |
Definition at line 1152 of file RPCUtils.h.
|
inlineprotected |
Definition at line 1228 of file RPCUtils.h.
|
inlineprotected |
Definition at line 1219 of file RPCUtils.h.
|
inline |
Handle one incoming call.
Definition at line 1078 of file RPCUtils.h.
|
inlineprotected |
Definition at line 1186 of file RPCUtils.h.
|
inline |
Negotiate a function id for Func with the other end of the channel.
Definition at line 1002 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 1110 of file RPCUtils.h.
|
inline |
Remove the handler for the given function.
A handler must currently be registered for this function.
Definition at line 1135 of file RPCUtils.h.
|
inline |
Definition at line 1068 of file RPCUtils.h.
|
inlineprotected |
Definition at line 1299 of file RPCUtils.h.
|
inlineprotected |
Definition at line 1266 of file RPCUtils.h.
|
protected |
Definition at line 1335 of file RPCUtils.h.
|
protected |
Definition at line 1339 of file RPCUtils.h.
|
protected |
Definition at line 1345 of file RPCUtils.h.
|
protected |
Definition at line 1337 of file RPCUtils.h.
|
protected |
Definition at line 1342 of file RPCUtils.h.
|
protected |
Definition at line 1350 of file RPCUtils.h.
|
protected |
Definition at line 1343 of file RPCUtils.h.
|
protected |
Definition at line 1341 of file RPCUtils.h.
|
protected |
Definition at line 1347 of file RPCUtils.h.
|
protected |
Definition at line 1348 of file RPCUtils.h.
1.8.13