def link(self, task, slot, *args, **kwargs): '''Add an on_complete message with the given args''' msg = Message.n(task, slot, *args, **kwargs) self._state.m.set(dict(on_complete=msg._id)) return msg
def start(self, *args, **kwargs): '''Send a 'run' message & update state''' self._state.m.set(dict(status='active')) msg = Message.new(self, 'run', args, kwargs) msg.send() return msg
def schedule(self, after, *args, **kwargs): '''Send a 'run' message & update state''' self._state.m.set(dict(status='pending')) msg = Message.new(self, 'run', args, kwargs, after=after) msg.send() return msg
def start(self, *args, **kwargs): '''Send a 'run' message & update state''' self._state.m.set(dict(status='active')) msg = Message.new(self, 'run', args, kwargs, send=True) return msg
def schedule(self, after, *args, **kwargs): """Send a 'run' message & update state""" self._state.m.set(dict(status="pending")) msg = Message.new(self, "run", args, kwargs, after=after) msg.send() return msg
def start(self, *args, **kwargs): """Send a 'run' message & update state""" self._state.m.set(dict(status="active")) msg = Message.new(self, "run", args, kwargs) msg.send() return msg