|
LLVM
4.0.0
|
#include <RPCUtils.h>
Public Types | |
| using | LaunchPolicy = typename BaseClass::LaunchPolicy |
| The LaunchPolicy type allows a launch policy to be specified when adding a function handler. More... | |
| template<typename Func > | |
| using | NonBlockingCallResult = typename detail::ResultTraits< typename Func::ReturnType >::ReturnFutureType |
| Return type for non-blocking call primitives. More... | |
Public Member Functions | |
| MultiThreadedRPCEndpoint (ChannelT &C, bool LazyAutoNegotiation) | |
| template<typename Func , typename HandlerT > | |
| void | addHandler (HandlerT Handler, LaunchPolicy Launch=LaunchPolicy()) |
| Add a handler for the given RPC function. More... | |
| template<typename Func , typename ClassT , typename RetT , typename... ArgTs> | |
| void | addHandler (ClassT &Object, RetT(ClassT::*Method)(ArgTs...), LaunchPolicy Launch=LaunchPolicy()) |
| Add a class-method as a handler. 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... ArgTs> | |
| Expected < NonBlockingCallResult< Func > > | appendCallNB (const ArgTs &...Args) |
| Call Func on Channel C. More... | |
| template<typename Func , typename... ArgTs> | |
| Expected < NonBlockingCallResult< Func > > | callNB (const ArgTs &...Args) |
| The same as appendCallNBWithSeq, except that it calls C.send() to flush the channel after serializing the call. More... | |
| template<typename Func , typename... ArgTs, typename AltRetT = typename Func::ReturnType> | |
| detail::ResultTraits< AltRetT > ::ErrorReturnType | callB (const ArgTs &...Args) |
| Call Func on Channel C. More... | |
| Error | handlerLoop () |
| Handle incoming RPC calls. More... | |
Public Member Functions inherited from llvm::orc::rpc::detail::RPCEndpointBase< MultiThreadedRPCEndpoint< ChannelT, FunctionIdT, SequenceNumberT >, ChannelT, FunctionIdT, SequenceNumberT > | |
| RPCEndpointBase (ChannelT &C, bool LazyAutoNegotiation) | |
| Construct an RPC instance on a channel. More... | |
| Error | appendCallAsync (HandlerT Handler, const ArgTs &...Args) |
| Append a call Func, does not call send on the channel. More... | |
| Error | sendAppendedCalls () |
| Error | callAsync (HandlerT Handler, const ArgTs &...Args) |
| Error | handleOne () |
| Handle one incoming call. More... | |
| void | abandonPendingResponses () |
| Abandon all outstanding result handlers. More... | |
Definition at line 1057 of file RPCUtils.h.
| using llvm::orc::rpc::MultiThreadedRPCEndpoint< ChannelT, FunctionIdT, SequenceNumberT >::LaunchPolicy = typename BaseClass::LaunchPolicy |
The LaunchPolicy type allows a launch policy to be specified when adding a function handler.
See addHandler.
Definition at line 1073 of file RPCUtils.h.
| using llvm::orc::rpc::MultiThreadedRPCEndpoint< ChannelT, FunctionIdT, SequenceNumberT >::NonBlockingCallResult = typename detail::ResultTraits< typename Func::ReturnType>::ReturnFutureType |
Return type for non-blocking call primitives.
Definition at line 1136 of file RPCUtils.h.
|
inline |
Definition at line 1068 of file RPCUtils.h.
|
inline |
Add a handler for the given RPC function.
This installs the given handler functor for the given RPC Function, and makes the RPC function available for negotiation/calling from the remote.
The optional LaunchPolicy argument can be used to control how the handler is run when called:
Definition at line 1093 of file RPCUtils.h.
|
inline |
Add a class-method as a handler.
Definition at line 1100 of file RPCUtils.h.
|
inline |
Call Func on Channel C.
Does not block, does not call send. Returns a pair of a future result and the sequence number assigned to the result.
This utility function is primarily used for single-threaded mode support, where the sequence number can be used to wait for the corresponding result. In multi-threaded mode the appendCallNB method, which does not return the sequence numeber, should be preferred.
Definition at line 1146 of file RPCUtils.h.
References llvm::orc::rpc::detail::RPCEndpointBase< MultiThreadedRPCEndpoint< ChannelT, FunctionIdT, SequenceNumberT >, ChannelT, FunctionIdT, SequenceNumberT >::abandonPendingResponses(), and llvm::Error::success().
|
inline |
Call Func on Channel C.
Blocks waiting for a result. Returns an Error for void functions or an Expected<T> for functions returning a T.
This function is for use in threaded code where another thread is handling responses and incoming calls.
Definition at line 1193 of file RPCUtils.h.
References llvm::orc::rpc::detail::RPCEndpointBase< MultiThreadedRPCEndpoint< ChannelT, FunctionIdT, SequenceNumberT >, ChannelT, FunctionIdT, SequenceNumberT >::abandonPendingResponses(), and llvm::orc::rpc::detail::ResultTraits< RetT >::consumeAbandoned().
|
inline |
The same as appendCallNBWithSeq, except that it calls C.send() to flush the channel after serializing the call.
Definition at line 1172 of file RPCUtils.h.
References llvm::orc::rpc::detail::RPCEndpointBase< MultiThreadedRPCEndpoint< ChannelT, FunctionIdT, SequenceNumberT >, ChannelT, FunctionIdT, SequenceNumberT >::abandonPendingResponses(), and llvm::orc::rpc::detail::ResultTraits< RetT >::consumeAbandoned().
|
inline |
Handle incoming RPC calls.
Definition at line 1207 of file RPCUtils.h.
References llvm::orc::rpc::detail::RPCEndpointBase< MultiThreadedRPCEndpoint< ChannelT, FunctionIdT, SequenceNumberT >, ChannelT, FunctionIdT, SequenceNumberT >::handleOne(), and llvm::Error::success().
|
inline |
Negotiate a function id for Func with the other end of the channel.
Definition at line 1108 of file RPCUtils.h.
References llvm::orc::rpc::detail::RPCEndpointBase< MultiThreadedRPCEndpoint< ChannelT, FunctionIdT, SequenceNumberT >, ChannelT, FunctionIdT, SequenceNumberT >::getInvalidFunctionId(), I, llvm::orc::orcError(), llvm::orc::rpc::detail::RPCEndpointBase< MultiThreadedRPCEndpoint< ChannelT, FunctionIdT, SequenceNumberT >, ChannelT, FunctionIdT, SequenceNumberT >::RemoteFunctionIds, llvm::Error::success(), and llvm::orc::UnknownRPCFunction.
1.8.6