so I'm pretty new to c# and I've came around this problem:
I have some methods that invoke different delegates (with potentially different argument types). However these delegates shouldn't be called right away. If the main Thread is running a delegate, they should run afterwards, kinda like queuing the delegate and running it later.
Now I could probably use DynamicInvoke but I don't know if it will slow the queue down too much, besides I know what the delegate type is and what kind of parameter it should look for, so its not really runtime dependent.
Please help me if you can, I really need an answer.
Thanks everybody (who responds)
One of the ways is doing that could be use of
Tasks
(beginning from.NET 4.0
)Can have a look on
Asynchronous methods, C# iterators, and Tasks
how to create scheduling tasks, like, seems, in your case.
Hope this helps.