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

Method start

examples/wssrv.py:194–218  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

192 self.start()
193
194 def start(self):
195 assert not self._started
196 self._started = True
197
198 up_read, up_write = os.pipe()
199 down_read, down_write = os.pipe()
200 args, sock = self.args, self.sock
201
202 pid = os.fork()
203 if pid:
204 # parent
205 os.close(up_read)
206 os.close(down_write)
207 asyncio.async(self.connect(pid, up_write, down_read))
208 else:
209 # child
210 os.close(up_write)
211 os.close(down_read)
212
213 # cleanup after fork
214 asyncio.set_event_loop(None)
215
216 # setup process
217 process = ChildProcess(up_read, down_write, args, sock)
218 process.start()
219
220 @asyncio.coroutine
221 def heartbeat(self, writer):

Callers 5

__init__Method · 0.95
heartbeatMethod · 0.95
chatMethod · 0.95
run_tornadoFunction · 0.45
runFunction · 0.45

Calls 4

connectMethod · 0.95
startMethod · 0.95
ChildProcessClass · 0.70
closeMethod · 0.45

Tested by

no test coverage detected