summaryrefslogtreecommitdiff
path: root/realtime/rt/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'realtime/rt/util.py')
-rw-r--r--realtime/rt/util.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/realtime/rt/util.py b/realtime/rt/util.py
new file mode 100644
index 00000000..7f877161
--- /dev/null
+++ b/realtime/rt/util.py
@@ -0,0 +1,13 @@
+import subprocess
+import threading
+
+def popen_io(cmd):
+ p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ consume_stream(p.stderr)
+ return p
+
+def consume_stream(stream):
+ def consume(s):
+ for _ in s:
+ pass
+ threading.Thread(target=consume, args=(stream,)).start()