コード例 #1
0
 def test_immediate_closed(self):
     ch = Channel()
     ch.close()
     self.assertEqual((yield put(ch, 42)), False)
コード例 #2
0
 def test_immediate_closed(self):
     ch = Channel()
     ch.close()
     self.assertEqual((yield take(ch)), CLOSED)
コード例 #3
0
def identity_channel(x):
    ch = Channel(1)
    put_then_callback(ch, x, lambda ok: ch.close())
    return ch