Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 2
    I love it when an old question gets a modern update. Have an upvote. I haven't checked out IAsyncEnumerable but am very familiar with javascript's Symbol.asyncIterator which looks like more or less the same concept. Commented Apr 30, 2019 at 1:33
  • Thanks @spender! I think so, it's basically an IEnumerable, but you can asynchronously await new items so it's a non-blocking operation. Commented Apr 30, 2019 at 1:41
  • I wonder, is there any specific reason for using SemaphoreSlim(1) instead of a lock ? Commented May 1, 2020 at 13:05
  • 4
    @valori inside a lock there can't be an await Commented May 2, 2020 at 8:50
  • 1
    cancellation token could be given to WaitAsync(token) as param too Commented Jan 19, 2023 at 13:33