asynchronous delegate question

M

Matthias S.

Hi there,

I'd like to invoke a couple of methods retrieved from multiple,
dynamically loaded Assemblies (I have the MethodInfo objects)
asynchronously and wait for all methods to finish processing before I
continue. The method signature is:

public void ProcessJob(JobInfo job);

Can this be done? If so, how? Thanks in advance.

Kind regards, Matthias

--
 
I

Ignacio Machin ( .NET/ C# MVP )

Hi there,

I'd like to invoke a couple of methods retrieved from multiple,
dynamically loaded Assemblies (I have the MethodInfo objects)
asynchronously and wait for all methods to finish processing before I
continue. The method signature is:

I do not understand that part of async and wait for all?
Or do you mean that you will fire them at the same time and wait for
all to finish?

Take a look at WaitHandler.WaitAll
 
B

Ben Voigt [C++ MVP]

Matthias said:
Hi there,

I'd like to invoke a couple of methods retrieved from multiple,
dynamically loaded Assemblies (I have the MethodInfo objects)
asynchronously and wait for all methods to finish processing before I
continue. The method signature is:

public void ProcessJob(JobInfo job);

Can this be done? If so, how? Thanks in advance.

http://msdn.microsoft.com/en-us/library/system.delegate.createdelegate.aspx

Then you'd just call BeginInvoke/EndInvoke just as you would with a delegate
created using the C# compile-time syntax. WaitAll with
IAsyncResult.WaitHandle of the return value from BeginInvoke.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top