In the official docs that says:
class tornado.tcpclient.TCPClient(resolver=None, io_loop=None)
connect(host, port, af=<AddressFamily.AF_UNSPEC: 0>, ssl_options=None, max_buffer_size=None)
Asynchronously returns an
IOStream
import tornado.gen
import tornado.tcpclient
import tornado.ioloop
@tornado.gen.coroutine
def main():
return tornado.tcpclient.TCPClient.connect('127.0.0.1', '8888')
result = tornado.ioloop.IOLoop.instance().run_sync(main)
I thought the result is a IOStream object.In fact, It's a Future object.
So, why isn't it a IOStream object ?
the document http://www.tornadoweb.org/en/stable/tcpclient.html says: Asynchronously returns an IOStream (or SSLIOStream if ssl_options is not None).
in tornado, the asynchronous methods return future object.