Show active RPC requests in the connections tab. Probably TMI, but I want greater introspection into what is going on, and this seemed like a positive step.
This commit is contained in:
17
src/ssb.h
17
src/ssb.h
@ -38,6 +38,7 @@ typedef enum _tf_ssb_change_t
|
||||
k_tf_ssb_change_create,
|
||||
k_tf_ssb_change_connect,
|
||||
k_tf_ssb_change_remove,
|
||||
k_tf_ssb_change_update,
|
||||
} tf_ssb_change_t;
|
||||
|
||||
/**
|
||||
@ -658,13 +659,14 @@ void tf_ssb_remove_rpc_callback(tf_ssb_t* ssb, const char** name, tf_ssb_rpc_cal
|
||||
** @param connection The connection on which to send the message.
|
||||
** @param flags The message flags.
|
||||
** @param request_number The request number.
|
||||
** @param new_request_name The name of the request if it is new.
|
||||
** @param message The message payload.
|
||||
** @param size The size of the message.
|
||||
** @param callback A callback to call if a response is received.
|
||||
** @param cleanup A callback to call if the callback is removed.
|
||||
** @param user_data User data to pass to the callback.
|
||||
*/
|
||||
void tf_ssb_connection_rpc_send(tf_ssb_connection_t* connection, uint8_t flags, int32_t request_number, const uint8_t* message, size_t size, tf_ssb_rpc_callback_t* callback,
|
||||
void tf_ssb_connection_rpc_send(tf_ssb_connection_t* connection, uint8_t flags, int32_t request_number, const char* new_request_name, const uint8_t* message, size_t size, tf_ssb_rpc_callback_t* callback,
|
||||
tf_ssb_callback_cleanup_t* cleanup, void* user_data);
|
||||
|
||||
/**
|
||||
@ -672,13 +674,14 @@ void tf_ssb_connection_rpc_send(tf_ssb_connection_t* connection, uint8_t flags,
|
||||
** @param connection The connection on which to send the message.
|
||||
** @param flags The message flags.
|
||||
** @param request_number The request number.
|
||||
** @param new_request_name The name of the request if it is new.
|
||||
** @param message The JS message payload.
|
||||
** @param callback A callback to call if a response is received.
|
||||
** @param cleanup A callback to call if the callback is removed.
|
||||
** @param user_data User data to pass to the callback.
|
||||
*/
|
||||
void tf_ssb_connection_rpc_send_json(
|
||||
tf_ssb_connection_t* connection, uint8_t flags, int32_t request_number, JSValue message, tf_ssb_rpc_callback_t* callback, tf_ssb_callback_cleanup_t* cleanup, void* user_data);
|
||||
tf_ssb_connection_t* connection, uint8_t flags, int32_t request_number, const char* new_request_name, JSValue message, tf_ssb_rpc_callback_t* callback, tf_ssb_callback_cleanup_t* cleanup, void* user_data);
|
||||
|
||||
/**
|
||||
** Send a MUXRPC error message.
|
||||
@ -703,12 +706,13 @@ void tf_ssb_connection_rpc_send_error_method_not_allowed(tf_ssb_connection_t* co
|
||||
** request number.
|
||||
** @param connection The connection on which to register the callback.
|
||||
** @param request_number The request number.
|
||||
** @param name The name of the RPC request.
|
||||
** @param callback The callback.
|
||||
** @param cleanup The function to call when the callback is removed.
|
||||
** @param user_data User data to pass to the callback.
|
||||
** @param dependent_connection A connection, which, if removed, invalidates this request.
|
||||
*/
|
||||
void tf_ssb_connection_add_request(tf_ssb_connection_t* connection, int32_t request_number, tf_ssb_rpc_callback_t* callback, tf_ssb_callback_cleanup_t* cleanup, void* user_data,
|
||||
void tf_ssb_connection_add_request(tf_ssb_connection_t* connection, int32_t request_number, const char* name, tf_ssb_rpc_callback_t* callback, tf_ssb_callback_cleanup_t* cleanup, void* user_data,
|
||||
tf_ssb_connection_t* dependent_connection);
|
||||
|
||||
/**
|
||||
@ -719,6 +723,13 @@ void tf_ssb_connection_add_request(tf_ssb_connection_t* connection, int32_t requ
|
||||
*/
|
||||
void tf_ssb_connection_remove_request(tf_ssb_connection_t* connection, int32_t request_number);
|
||||
|
||||
/**
|
||||
** Get a debug representation of active requests.
|
||||
** @param connection The connection.
|
||||
** @return The active requests as a JS object.
|
||||
*/
|
||||
JSValue tf_ssb_connection_requests_to_object(tf_ssb_connection_t* connection);
|
||||
|
||||
/**
|
||||
** A function scheduled to be run later.
|
||||
** @param connection The owning connection.
|
||||
|
Reference in New Issue
Block a user