Stormancer::RpcService Class Reference

Classes

struct  ClientRpcOptions
 Options for client-to-server RPCs. More...
 
struct  ServerRpcOptions
 Options for server-to-client RPCs. More...
 

Public Member Functions

 RpcService (std::weak_ptr< Scene > scene, std::shared_ptr< IActionDispatcher > dispatcher)
 
void addProcedure (const std::string &route, std::function< pplx::task< void >(RpcRequestContext_ptr)> handler, MessageOriginFilter filter=MessageOriginFilter::Host, bool ordered=false)
 Add a procedure to execute when the server send an RPC.
 
void addProcedure (const std::string &route, std::function< pplx::task< void >(RpcRequestContext_ptr)> handler, const ServerRpcOptions &options)
 
uint16 pendingRequests ()
 
void cancelAll (const std::string &reason)
 Cancel all RPCs.
 
std::shared_ptr< IActionDispatchergetDispatcher ()
 
rxcpp::observable< Packetisp_ptr > rpcObservable (const std::string &route, const StreamWriter &streamWriter, PacketPriority priority=PacketPriority::MEDIUM_PRIORITY)
 Send an RPC and returns an observable.
 
rxcpp::observable< Packetisp_ptr > rpcObservable (const std::string &route, const StreamWriter &streamWriter, const ClientRpcOptions &options)
 
template<typename TOut = void, typename... TIn>
pplx::task< TOut > rpc (const std::string &route, pplx::cancellation_token ct, const TIn &... args)
 
template<typename TOut = void, typename TStreamWriter >
std::enable_if< std::is_convertible< TStreamWriter, StreamWriter >::value, pplx::task< TOut > >::type rpc (const std::string &route, pplx::cancellation_token ct, const TStreamWriter &streamWriter)
 
template<typename TOut = void, typename... TIn>
pplx::task< TOut > rpc (const std::string &route, const TIn &... args)
 
template<typename TOut = void, typename TStreamWriter >
std::enable_if< std::is_convertible< TStreamWriter, StreamWriter >::value, pplx::task< TOut > >::type rpc (const std::string &route, const TStreamWriter &streamWriter)
 
template<>
pplx::task< Packetisp_ptr > rpcImpl (rxcpp::observable< Packetisp_ptr > observable, const std::string &route, pplx::cancellation_token ct)
 

Friends

class RpcPlugin
 

The documentation for this class was generated from the following file:
  • stormancer/stormancer-sources/include/public/stormancer/RPC/RpcService.h