Did I find the right examples for you? yes no

All Samples(18)  |  Call(16)  |  Derive(0)  |  Import(2)

src/e/l/eliot-0.3.0/benchmarks/logwriter.py   eliot(Download)
from twisted.python.filepath import FilePath
 
from eliot.logwriter import ThreadedFileWriter
 
 
def main(reactor):
    print "Message size: %d bytes   Num messages: %d" % (LENGTH, MESSAGES)
    message = b"a" * LENGTH
    fp = FilePath(tempfile.mktemp())
    writer = ThreadedFileWriter(fp.open("ab"), reactor)
    writer.startService()
 
    start = time.time()
    for i in range(MESSAGES):
        writer(message)

src/e/l/eliot-0.3.0/eliot/tests/test_logwriter.py   eliot(Download)
    # Make sure we always import this if Twisted is available, so broken
    # logwriter.py causes a failure:
    from eliot.logwriter import ThreadedFileWriter
 
from eliot import Logger, removeDestination
        L{IService} interface.
        """
        writer = ThreadedFileWriter(BytesIO(), reactor)
        self.assertFalse(writer.running)
        writer.startService()
        L{IService} interface.
        """
        writer = ThreadedFileWriter(BytesIO(), reactor)
        writer.startService()
        d = writer.stopService()
                result.append(current)
            event.set()
        writer = ThreadedFileWriter(BytesIO(), reactor)
        writer._writer = _writer
        writer.startService()
        """
        previousThreads = set(threading.enumerate())
        writer = ThreadedFileWriter(BytesIO(), reactor)
        writer.startService()
        start = time.time()