fdroidserver.asynchronousfilereader package¶
Simple thread based asynchronous file reader for Python.
AsynchronousFileReader¶
see https://github.com/soxofaan/asynchronousfilereader
MIT License Copyright (c) 2014 Stefaan Lippens
- class fdroidserver.asynchronousfilereader.AsynchronousFileReader(fd, queue=None, autostart=True)¶
Bases:
Thread
Helper class to implement asynchronous reading of a file in a separate thread.
Pushes read lines on a queue to be consumed in another thread.
- Attributes:
daemon
A boolean value indicating whether this thread is a daemon thread.
ident
Thread identifier of this thread or None if it has not been started.
name
A string used for identification purposes only.
native_id
Native integral thread ID of this thread, or None if it has not been started.
Methods
eof
()Check whether there is no more content to expect.
getName
()Return a string used for identification purposes only.
isDaemon
()Return whether this thread is a daemon.
is_alive
()Return whether the thread is alive.
join
([timeout])Wait until the thread terminates.
Get currently available lines.
run
()Read lines and put them on the queue (the body of the tread).
setDaemon
(daemonic)Set whether this thread is a daemon.
setName
(name)Set the name string for this thread.
start
()Start the thread's activity.
- eof()¶
Check whether there is no more content to expect.
- readlines()¶
Get currently available lines.
- run()¶
Read lines and put them on the queue (the body of the tread).