|
|
Subscribe / Log in / New account

Losing Data? Async specific?

Losing Data? Async specific?

Posted Sep 25, 2025 11:27 UTC (Thu) by kpfleming (subscriber, #23250)
In reply to: Losing Data? Async specific? by Fowl
Parent article: Canceling asynchronous Rust

> If a sending a message times out or is cancelled, isn't it expected that it is "lost" without some retry or other logic? How is this an async specific problem?

Yes, but the example code doesn't allow retry (nor does your blocking example), because the message was already consumed by passing it as an argument to the send() function. Of course the send() function could be changed to accept an immutable reference instead, but then that makes the code using the function more complex because it must ensure that the message gets dropped in the correct situations.


to post comments

Losing Data? Async specific?

Posted Sep 26, 2025 7:55 UTC (Fri) by taladar (subscriber, #68407) [Link]

Some similar APIs also just return the owned value to you as part of the timeout.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds