Skip to content

Commit 9a03faf

Browse files
author
GueLaKais
committed
To understand clientbase execute method better
1 parent 3eded95 commit 9a03faf

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

rclrs/src/client.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,20 @@ where
315315
fn handle(&self) -> &ClientHandle {
316316
&self.handle
317317
}
318-
318+
/// Executes the client by taking a response from the underlying `rcl_client_t` instance
319+
/// and handling it appropriately.
320+
///
321+
/// This method attempts to take a response from the client using `take_response`. If a response
322+
/// is successfully taken, it is processed by either calling the associated callback or sending
323+
/// the response to the associated future.
324+
///
325+
/// If the `take_response` method returns a `ClientTakeFailed` error, it is treated as a
326+
/// spurious wakeup and is not considered an error.
327+
///
328+
/// # Returns
329+
///
330+
/// `Ok(())` if the response was successfully processed or if a spurious wakeup occurred.
331+
/// `Err(RclrsError)` if an error occurred while taking or processing the response.
319332
fn execute(&self) -> Result<(), RclrsError> {
320333
let (res, req_id) = match self.take_response() {
321334
Ok((res, req_id)) => (res, req_id),

0 commit comments

Comments
 (0)