示例#1
0
文件: observer.py 项目: pepribas/F3AT
    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)
示例#3
0
文件: shard_agent.py 项目: f3at/feat
 def on_goodbye(self, agent):
     return fiber.maybe_fiber(agent.fix_shard_structure)