Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/simple_rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct EchoOperation {}

#[async_trait::async_trait]
impl RequestHandler for EchoOperation {
async fn invoke_method(
async fn handle_request(
&self,
_resource_id: u16,
request_payload: Option<UPayload>,
Expand Down
12 changes: 6 additions & 6 deletions src/communication/in_memory_rpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl RequestListener {
debug!(ttl = request_timeout, id = %request_id, "processing RPC request");

let invocation_result_future =
request_handler_clone.invoke_method(resource_id, request_payload);
request_handler_clone.handle_request(resource_id, request_payload);
let outcome = tokio::time::timeout(
Duration::from_millis(request_timeout as u64),
invocation_result_future,
Expand Down Expand Up @@ -433,7 +433,7 @@ mod tests {
let message_id = UUID::build();
let request_id = message_id.clone();

request_handler.expect_invoke_method().never();
request_handler.expect_handle_request().never();
transport
.expect_do_send()
.once()
Expand Down Expand Up @@ -501,7 +501,7 @@ mod tests {
async fn test_request_listener_ignores_invalid_request() {
// GIVEN an RpcServer for a transport
let mut request_handler = MockRequestHandler::new();
request_handler.expect_invoke_method().never();
request_handler.expect_handle_request().never();
let mut transport = MockTransport::new();
transport.expect_do_send().never();

Expand Down Expand Up @@ -554,7 +554,7 @@ mod tests {
let message_id_clone = message_id.clone();

request_handler
.expect_invoke_method()
.expect_handle_request()
.once()
.withf(|resource_id, request_payload| {
if let Some(pl) = request_payload {
Expand Down Expand Up @@ -623,7 +623,7 @@ mod tests {
let message_id_clone = message_id.clone();

request_handler
.expect_invoke_method()
.expect_handle_request()
.once()
.withf(|resource_id, _request_payload| *resource_id == 0x7000_u16)
.returning(|_resource_id, _request_payload| {
Expand Down Expand Up @@ -681,7 +681,7 @@ mod tests {
struct NonRespondingHandler;
#[async_trait]
impl RequestHandler for NonRespondingHandler {
async fn invoke_method(
async fn handle_request(
&self,
resource_id: u16,
_request_payload: Option<UPayload>,
Expand Down
6 changes: 3 additions & 3 deletions src/communication/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ impl dyn RpcClient {
#[cfg_attr(test, automock)]
#[async_trait]
pub trait RequestHandler: Send + Sync {
/// Invokes a method with given input parameters.
/// Handles a request to invoke a method with given input parameters.
///
/// Implementations MUST NOT block the calling thread. Long running
/// computations should be performed on a separate worker thread, yielding
Expand All @@ -230,8 +230,8 @@ pub trait RequestHandler: Send + Sync {
///
/// # Errors
///
/// Returns an error if the method request could not be processed successfully.
async fn invoke_method(
/// Returns an error if the request could not be processed successfully.
async fn handle_request(
&self,
resource_id: u16,
request_payload: Option<UPayload>,
Expand Down