asynchronous delegate question

  • Thread starter Thread starter Matthias S.
  • Start date Start date
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

--
 
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
 
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.
 
Back
Top