Supplying an Application instance when dequeuing a job
Andrewangeta opened this issue · 2 comments
Andrewangeta commented
It would be advantageous to have access to an instance of Application
when dequeueing a job.
Maybe having it added as a property on the JobContext
func dequeue(_ context: JobContext, _ payload: SomeJob) -> EventLoopFuture<Void> {
context.application.someService.....
}
tanner0101 commented
As a workaround, app.jobs.configuration
has a userInfo
dict that you can put whatever you need into. Then you can access that from context.configuration
Andrewangeta commented
Sounds good.