Did I find the right examples for you? yes no

All Samples(9)  |  Call(9)  |  Derive(0)  |  Import(0)

src/e/l/eliot-0.3.0/benchmarks/logwriter.py   eliot(Download)
    for i in range(MESSAGES):
        writer(message)
    d = writer.stopService()
 
    def done(_):

src/e/l/eliot-0.3.0/eliot/tests/test_logwriter.py   eliot(Download)
        writer = ThreadedFileWriter(BytesIO(), reactor)
        writer.startService()
        d = writer.stopService()
        d.addCallback(lambda _: self.assertFalse(writer.running))
        return d
        # If not true the next assertion might pass by mistake:
        self.assertNotEqual(set(threading.enumerate()), previousThreads)
        writer.stopService()
        while set(threading.enumerate()) != previousThreads and (
                time.time() - start < 5):
            writer(b"write")
        threads = threading.enumerate()
        writer.stopService()
        # Make sure writes didn't happen before the stopService, thus making the
        # test pointless:
        writer(b"write")
        threads = threading.enumerate()
        d = writer.stopService()
        f.unblock()
 
        writer = ThreadedFileWriter(f, reactor)
        writer.startService()
        d = writer.stopService()
        def done(_):
            self.assertTrue(f.closed)