|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Classes | |
| class | _ThreadRouter |
Functions | |
| None | _install () |
| Iterator[io.StringIO] | thread_stdout () |
Variables | |
| _local = threading.local() | |
| _install_lock = threading.Lock() | |
Capture what one thread prints, without touching any other thread's output. ``contextlib.redirect_stdout`` swaps ``sys.stdout`` for the whole process. In the API, burns run on daemon threads two at a time: two overlapping flights restored each other's buffers, and the server went on printing into a StringIO for ever while other requests' prints landed in a run's notes. Here ``sys.stdout`` is replaced once by a router that sends a thread's writes to that thread's buffer while it is capturing, and everything else to the real stream.
|
protected |
Definition at line 45 of file capture.py.
Referenced by thread_stdout().
| Iterator[io.StringIO] engine.layerx.capture.thread_stdout | ( | ) |
Everything this thread prints inside the block, and nothing any other thread prints.
Definition at line 52 of file capture.py.
References _install().
|
protected |
Definition at line 19 of file capture.py.
|
protected |
Definition at line 18 of file capture.py.