MCPcopy Create free account
hub / github.com/wal-e/wal-e / popen_nonblock

Function popen_nonblock

wal_e/piper.py:73–91  ·  view source on GitHub ↗

Create a process in the same way as popen_sp, but patch the file descriptors so they can be accessed from Python/gevent in a non-blocking manner.

(*args, **kwargs)

Source from the content-addressed store, hash-verified

71
72
73def popen_nonblock(*args, **kwargs):
74 """
75 Create a process in the same way as popen_sp, but patch the file
76 descriptors so they can be accessed from Python/gevent
77 in a non-blocking manner.
78 """
79
80 proc = popen_sp(*args, **kwargs)
81
82 if proc.stdin:
83 proc.stdin = pipebuf.NonBlockBufferedWriter(proc.stdin)
84
85 if proc.stdout:
86 proc.stdout = pipebuf.NonBlockBufferedReader(proc.stdout)
87
88 if proc.stderr:
89 proc.stderr = pipebuf.NonBlockBufferedReader(proc.stderr)
90
91 return proc
92
93
94def pipe(*args):

Callers 1

psql_csv_runFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected