Robust Distributed System Nucleus (rDSN)  ver 1.0.0
Functions
Client-Side RPC Primitives

Overview

Functions

DSN_API dsn_task_t dsn_rpc_create_response_task (dsn_message_t request, dsn_rpc_response_handler_t cb, void *context, int reply_thread_hash DEFAULT(0), dsn_task_tracker_t tracker DEFAULT(nullptr))
 
DSN_API dsn_task_t dsn_rpc_create_response_task_ex (dsn_message_t request, dsn_rpc_response_handler_t cb, dsn_task_cancelled_handler_t on_cancel, void *context, int reply_thread_hash DEFAULT(0), dsn_task_tracker_t tracker DEFAULT(nullptr))
 
DSN_API void dsn_rpc_call (dsn_address_t server, dsn_task_t rpc_call)
 
DSN_API dsn_message_t dsn_rpc_call_wait (dsn_address_t server, dsn_message_t request)
 
DSN_API void dsn_rpc_call_one_way (dsn_address_t server, dsn_message_t request)
 
DSN_API dsn_message_t dsn_rpc_get_response (dsn_task_t rpc_call)
 
DSN_API void dsn_rpc_enqueue_response (dsn_task_t rpc_call, dsn_error_t err, dsn_message_t response)
 

Function Documentation

DSN_API dsn_task_t dsn_rpc_create_response_task ( dsn_message_t  request,
dsn_rpc_response_handler_t  cb,
void *  context,
int reply_thread_hash   DEFAULT0,
dsn_task_tracker_t tracker   DEFAULTnullptr 
)

create a callback task to handle the response message from RPC server, or timeout.

Parameters
requestrpc request message
cbcallback to handle rpc response or timeout, unlike the other kinds of tasks, response tasks are always executed in the thread pool invoking the rpc
contextcontext used by cb
reply_thread_hashif the curren thread pool is partitioned, this specify which thread to execute the callback
trackertask tracker bound to the response task
Returns
response task handle
DSN_API dsn_task_t dsn_rpc_create_response_task_ex ( dsn_message_t  request,
dsn_rpc_response_handler_t  cb,
dsn_task_cancelled_handler_t  on_cancel,
void *  context,
int reply_thread_hash   DEFAULT0,
dsn_task_tracker_t tracker   DEFAULTnullptr 
)

create a callback task to handle the response message from RPC server, or timeout.

Parameters
requestrpc request message
cbcallback to handle rpc response or timeout, unlike the other kinds of tasks, response tasks are always executed in the thread pool invoking the rpc
on_cancelcallback executed on task being-cancelled
contextcontext used by cb
reply_thread_hashif the curren thread pool is partitioned, this specify which thread to execute the callback
trackertask tracker bound to the response task
Returns
response task handle