jiangok
jiangok

Reputation: 2692

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.

Upvotes: 4

Views: 3862

Answers (1)

Athari
Athari

Reputation: 34275

You should probably use BeginInvoke overload with AsyncCallback argument.

Upvotes: 8

Related Questions