I am just trying to get this set up - and whilst the intro and documentation has been amazing, I seem to have gotten myself into a spot of bother.
I am trying to schedule background tasks, based on Methods stored as strings in variables.
i.e. I have a series of dynamically run checks based on a host’s config - and if a check fails, I want to run the relevant code for THAT sepecific check.
My code looks like this:
public void BackGroundThatJob (string desiredClass, string methodName, int id)
{
Type t = Type.GetType(desiredClass);
// create instance of class t
object tInstance = Activator.CreateInstance(t);
BackgroundJob.Enqueue(() => t.InvokeMember(methodName,
BindingFlags.InvokeMethod | BindingFlags.Instance | BindingFlags.Public,
null, tInstance, new object[] { id }));
(I typed this on the way out the door - but the above info should provide what my intention is)
Anyway, the result is that the job gets enqueued, but never moves from there . . AND the “enqueued” panel does not show the jobs.
Any help would be appreciated.
Thanks
Alan