本文整理汇总了Python中tornado.options.options.chunk_size方法的典型用法代码示例。如果您正苦于以下问题:Python options.chunk_size方法的具体用法?Python options.chunk_size怎么用?Python options.chunk_size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tornado.options.options
的用法示例。
在下文中一共展示了options.chunk_size方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from tornado.options import options [as 别名]
# 或者: from tornado.options.options import chunk_size [as 别名]
def main():
parse_command_line()
app = Application([('/', ChunkHandler)])
app.listen(options.port, address='127.0.0.1')
def callback(response):
response.rethrow()
assert len(response.body) == (options.num_chunks * options.chunk_size)
logging.warning("fetch completed in %s seconds", response.request_time)
IOLoop.instance().stop()
logging.warning("Starting fetch with curl client")
curl_client = CurlAsyncHTTPClient()
curl_client.fetch('http://localhost:%d/' % options.port,
callback=callback)
IOLoop.instance().start()
logging.warning("Starting fetch with simple client")
simple_client = SimpleAsyncHTTPClient()
simple_client.fetch('http://localhost:%d/' % options.port,
callback=callback)
IOLoop.instance().start()
示例2: main
# 需要导入模块: from tornado.options import options [as 别名]
# 或者: from tornado.options.options import chunk_size [as 别名]
def main():
parse_command_line()
app = Application([('/', ChunkHandler)])
app.listen(options.port, address='127.0.0.1')
def callback(response):
response.rethrow()
assert len(response.body) == (options.num_chunks * options.chunk_size)
logging.warning("fetch completed in %s seconds", response.request_time)
IOLoop.current().stop()
logging.warning("Starting fetch with curl client")
curl_client = CurlAsyncHTTPClient()
curl_client.fetch('http://localhost:%d/' % options.port,
callback=callback)
IOLoop.current().start()
logging.warning("Starting fetch with simple client")
simple_client = SimpleAsyncHTTPClient()
simple_client.fetch('http://localhost:%d/' % options.port,
callback=callback)
IOLoop.current().start()
示例3: get
# 需要导入模块: from tornado.options import options [as 别名]
# 或者: from tornado.options.options import chunk_size [as 别名]
def get(self):
for i in xrange(options.num_chunks):
self.write('A' * options.chunk_size)
self.flush()
self.finish()