Async function
Hello guys,
what is the best way to stop a async function?
I made a async function, which monitors if a key is pressed. Should I use the cancel Token? And is Task<> with Return the only why to get something back from the function?
6 Replies
yes and yes
cancellation tokens are good for cancelling long running operations and async methods must return a Task (with one specific exception)
But their is no possible way, that is similar to ref Right?
i'm not sure what that means
ref - > reference is Not possible for async, is their a other way
like ref arguments? no
Ok
Thank you