Start with the idea
Selecting or timing out a future may drop it before completion. Keep partial state consistent across await points, or wrap the operation so retrying cannot duplicate or lose external effects.
An async operation may be cancelled when its future is dropped, often after it has yielded at an .await. Work already completed before that point remains completed. A dropped future does not reverse a file write, database transaction, sent message, or charge to an external service. This creates a gap between “the caller did not receive a result” and “nothing happened.” Retry logic must account for that gap.
Consider save_record().await followed by send_ack().await. If the task stops between the two awaits, the record exists but the acknowledgement may not.
Keep learning, for free
The rest of this lesson is waiting for you.
Create a free account to read the complete explanation, see the infographic, explore the code, and try the exercises. All 742 lessons and algorithm steps are included.
No payment details. Your account opens the complete Academy.