Esempio n. 1
0
 def test_success(self):
     outcomes = []
     d = defer.Deferred()
     d2 = fork_deferred(d)
     d.addCallback(lambda x: outcomes.append('dc ' + x))
     d2.addCallback(lambda x: outcomes.append('d2c ' + x))
     self.assertEquals(outcomes, [])
     d.callback('value')
     self.assertEquals(outcomes, ['d2c value', 'dc value'])
Esempio n. 2
0
 def when_closed(self):
     return fork_deferred(self.__disconnect_deferred)