Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (17 sloc) 597 Bytes
from nameko.dependencies import (
EntrypointProvider, entrypoint, DependencyFactory)
from nameko.exceptions import ContainerBeingKilled
class OnceProvider(EntrypointProvider):
def __init__(self, args, kwargs):
self.args = args
self.kwargs = kwargs
def start(self):
self.container.spawn_worker(self, self.args, self.kwargs)
except ContainerBeingKilled:
def once(*args, **kwargs):
""" Fire the decorated entrypoint once, immediately.
return DependencyFactory(OnceProvider, args, kwargs)
You can’t perform that action at this time.