Open Finistere opened 3 years ago
Currently @inject does not support any context manager. It would be great to have something like:
@inject
from contextlib import contextmanager from antidote import inject, resource @resource @contextamanger def database_connection(): # setup yield 'the database' # cleanup @inject(dependencies=dict(db=database_connection)) # or Database @ database_connection like factories ? def f(db): pass
Currently
@inject
does not support any context manager. It would be great to have something like: