Commit b8c71a0c authored by Xavier Barbosa's avatar Xavier Barbosa

documentation

parent cefaba60
Pipeline #188 passed with stages
......@@ -34,7 +34,28 @@ For example::
'bar': bar}
assert (yield from services.apply(fun)) == {'foo': 'I am foo',
'bar': 'I am bar'}
'bar': 'I am bar'}
Implementation
--------------
``annotate(*args, **kwargs)`` annotate a func with service names.
``coroutine Injector.factory(name)`` declare a service factory
``coroutine Injector.get(name)`` return the service instance
``coroutine Injector.apply(func, *args, **kwargs)`` call the annoted callable
with the mounted service.
``coroutine Injector.partial(func)`` prepare an annoted func with later services.
``coroutine Injector.close()`` clear all cached services., and call all deferred
close().
``coroutine Injector.close.register(obj)`` defers ``yield from obj.close()`` when
``Injector.close()`` is called.
.. _asyncio: https://pypi.python.org/pypi/asyncio
.. _jeni: https://pypi.python.org/pypi/jeni
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment