Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

Waiting on an event asynchronously

$
0
0

Hi Forms experts,

I've seen it's sort of possible to wait on events asynchronously with C# -- https://msdn.microsoft.com/en-us/library/hh873178(v=vs.110).aspx (note that the link is not being interpreted properly in the forums because of the brackets)

However, it looks like ThreadPool doesn't exist for Xamarin.

So to spell out what I'm trying to do here:

while(true) {
     await WaitForEventToBeSet(someEvent);  // someEvent auto-resets
     DoWork();
}
Somewhere else in the code:
someEvent.Set();

The key is, I don't want to block while waiting for the event - I want to wait asynchronously. Is this possible?

Thanks a lot,
Mike


Viewing all articles
Browse latest Browse all 75885

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>