Open aurthurm opened 1 year ago
My use case it to rum some jobs at some intervals. These jobs can not be run simpy by the sanic add_task as they are created deep inside the application. I have a Job service that needs to keep track of all created jobs and then runs them. These jobs also depend on services some with many dependencies, which is why i need dependency injection. I did not find a way to use default sanic dependency injection.
If there is a way to also use this library with apscheduler. i am open to other better alternative usecases
Thank you
@aurthurm Did you ever figured our wiring with sanic? For my I cannot get @inject to work. Like - I juts pull container from sanic context - and pull service from there, but automatic @inject wiring doesn't work with regular handlers (sanic 24.6).
I have a sanic app. I want to run some background jobs. I have configured the container but am getting unexpected beavior
here are my background task where they are added to sanic add_task
i registred my container as below
Finally i run sanic application
i then ran the app
The print(job_service) outputs
<dependency_injector.wiring.Provide object at 0x7f7079e17590>
The call
sorted = await job_service.fetch_sorted()
fails with error