AsyncEx icon indicating copy to clipboard operation
AsyncEx copied to clipboard

Feature Request: AsyncManualResetEvent pulse

Open danbopes opened this issue 2 years ago • 2 comments

The AsyncManualResetEvent in visualstudio.threading, supports single pulses of the manualresetevent.

Can we add something similar in nito?

See source code

danbopes avatar Jan 13 '22 12:01 danbopes

How would you expect to use this? I'm wondering if there is a more appropriate coordination primitive.

Nito.AsyncEx already has support for condition variables and monitors (and auto-reset events), which support pulsing. My hesitation around adding this to ManualResetEvent is that the Win32 (and BCL) MRE types do not support pulsing. But if it's useful enough for a specific use case that would be too awkward using something like a condition variable, then I'll certainly add it.

StephenCleary avatar Jan 13 '22 13:01 StephenCleary

NP, seems AsyncAutoResetEvent may fit my needs. I just saw it in a commonly used DLL by Microsoft, thought it would be a good addition here (For those that actually may have that corner case that could use it). Feel free to close, if you think it'd be an awkward add.

danbopes avatar Jan 13 '22 21:01 danbopes