MCPcopy
hub / github.com/fluentpython/example-code-2e / main

Function main

21-async/mojifinder/tcp_mojifinder.py:67–74  ·  view source on GitHub ↗
(host: str = '127.0.0.1', port_arg: str = '2323')

Source from the content-addressed store, hash-verified

65 await server.serve_forever() # <6>
66
67def main(host: str = '127.0.0.1', port_arg: str = '2323'):
68 port = int(port_arg)
69 print('Building index.')
70 index = InvertedIndex() # <7>
71 try:
72 asyncio.run(supervisor(index, host, port)) # <8>
73 except KeyboardInterrupt: # <9>
74 print('\nServer shut down.')
75
76if __name__ == '__main__':
77 main(*sys.argv[1:])

Callers 1

tcp_mojifinder.pyFile · 0.70

Calls 3

InvertedIndexClass · 0.90
supervisorFunction · 0.70
runMethod · 0.45

Tested by

no test coverage detected