MCPcopy
hub / github.com/aio-libs/aiohttp / stdin_callback

Function stdin_callback

examples/wsclient.py:23–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22 # input reader
23 def stdin_callback():
24 line = sys.stdin.buffer.readline().decode('utf-8')
25 if not line:
26 loop.stop()
27 else:
28 ws.send_str(name + ': ' + line)
29 loop.add_reader(sys.stdin.fileno(), stdin_callback)
30
31 @asyncio.coroutine

Callers

nothing calls this directly

Calls 4

decodeMethod · 0.80
readlineMethod · 0.45
stopMethod · 0.45
send_strMethod · 0.45

Tested by

no test coverage detected