Skip to content

Latest commit

 

History

History
15 lines (9 loc) · 863 Bytes

QuitChannel.md

File metadata and controls

15 lines (9 loc) · 863 Bytes

Quit Channel

Unlike the Timeout, where we cancel reading, this time we want to cancel the writing procedure. We need to modify our CreateMessenger() generator.

Now we need to pass our cancellation token to the generator which gives us control over the channel's longevity.

Joe had 10 messages to send, but we gave him only 5 seconds, for which he managed to send less than that. We can also manually send a cancellation request, for example, after reading N number of messages.

Next: Web Search » Previous: Timeout «