I'm wondering if its possible to create some kind of generic list of actions/funcs, each with different in/out params.
The reason I need this is I have an executer who's job is getting data from an API, each of the methods in that executer goes to a different path in that API, and I want to be able to schedule those requests so I won't overload that API (they will just block me if I pass their threshold of requests).
So each time a method in that executer is called, I will add that method and its params to a list, and another thread will run over the list and execute methods from there using some timeout.
I have to have this logic in the executer and not from it's caller.
So basically wondering if I can do something like:
List<Func<T,T>> scheduler;
Without declaring the types on creation but instead add different types during runtime.
If there is a better solution or pattern for this please do enlighten me.
[edit] obviously I don't want to implement something like:
Func<List<object>, object> scheduler