Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Powershell's BeginInvoke() and EndInvoke() in async way

Is there a way to use Powershell's BeginInvoke() and EndInvoke() in a real async way. That's, I just call BeginInvoke() and then forget instead of using EndInvoke to wait for the return or result. I like EndInvoke to be a callback function called automatically when BeginInvoke() finishes. The example on MSDN is actually a sync one.

How can I use BeginInvoke() and EndInvoke() in a real async way? Thanks.

like image 458
jiangok Avatar asked Feb 25 '23 11:02

jiangok


1 Answers

You should probably use BeginInvoke overload with AsyncCallback argument.

like image 155
Athari Avatar answered Mar 08 '23 07:03

Athari