def initiate(self): d = fiber.maybe_fiber(self._method, *self._args, **self._kwargs) d.addCallbacks(self._finished_cb, self._failed_cb) # Unreference everything we don't need anymore self._method = None self._args = None self._kwargs = None return d
def testAllocationExists(self): allocation = yield self.resources.allocate(a=3) a = yield fiber.maybe_fiber(self.resources.get_allocation, allocation.id) self.assertIsInstance(a, resource.Allocation)
def on_goodbye(self, agent): return fiber.maybe_fiber(agent.fix_shard_structure)