Hi, I need to handle event in body of my job.
For example I have code:
public class MyExecutor{
private readonly IMyProcessor _myProcessor;
public MyExecutor(){}
public MyExecutor(IMyProcessor jobProcessor)
{
_myProcessor = myProcessor;
}
public string ExecuteJob(long id)
{
return _myProcessor.ExecuteJob(id);
}
}
And run it in backgroud:
BackgroundJob.Enqueue(() => new MyExecutor().ExecuteJob(id));
Sometime when job is working, I need to call different method for instance of _myProcessor for current job. Or create and handle event for call?
How I can do it? Please help.