Motr
M0
|
#include <item_source.h>
Data Fields | |
bool(* | riso_has_item )(const struct m0_rpc_item_source *ris) |
struct m0_rpc_item *(* | riso_get_item )(struct m0_rpc_item_source *ris, m0_bcount_t max_payload_size) |
void(* | riso_conn_terminating )(struct m0_rpc_item_source *ris) |
Callbacks invoked by RPC on registered item-sources.
The callback subroutines are invoked within the scope of the RPC machine lock so should not make re-entrant calls to the RPC subsystem that take RPC machine lock.
Implementation of all of the callbacks is mandatory.
Definition at line 80 of file item_source.h.
void(* riso_conn_terminating) (struct m0_rpc_item_source *ris) |
This callback is invoked when rpc-connection is being terminated while the connection still has item-sources registered with it.
ris is deregistered before invoking this callback. Implementation of this routine can choose to free ris. RPC won't touch ris after this callback.
Definition at line 111 of file item_source.h.
struct m0_rpc_item*(* riso_get_item) (struct m0_rpc_item_source *ris, m0_bcount_t max_payload_size) |
Returns an item to be sent. Returns NULL if couldn't form an item. Payload size should not exceed max_payload_size.
Important: RPC reuses reference on returned item. If returned item has ref-count == 1 then the item will be freed as soon as it is sent/failed.
Definition at line 99 of file item_source.h.
bool(* riso_has_item) (const struct m0_rpc_item_source *ris) |
Returns true iff the item-source has item to send.
Definition at line 85 of file item_source.h.