()
| 28 | |
| 29 | |
| 30 | def main(): |
| 31 | parse_command_line() |
| 32 | app = Application([('/', ChunkHandler)]) |
| 33 | app.listen(options.port, address='127.0.0.1') |
| 34 | |
| 35 | def callback(response): |
| 36 | response.rethrow() |
| 37 | assert len(response.body) == (options.num_chunks * options.chunk_size) |
| 38 | logging.warning("fetch completed in %s seconds", response.request_time) |
| 39 | IOLoop.current().stop() |
| 40 | |
| 41 | logging.warning("Starting fetch with curl client") |
| 42 | curl_client = CurlAsyncHTTPClient() |
| 43 | curl_client.fetch('http://localhost:%d/' % options.port, |
| 44 | callback=callback) |
| 45 | IOLoop.current().start() |
| 46 | |
| 47 | logging.warning("Starting fetch with simple client") |
| 48 | simple_client = SimpleAsyncHTTPClient() |
| 49 | simple_client.fetch('http://localhost:%d/' % options.port, |
| 50 | callback=callback) |
| 51 | IOLoop.current().start() |
| 52 | |
| 53 | |
| 54 | if __name__ == '__main__': |
no test coverage detected