def __init__(self, host='localhost', port='9200', io_loop=None, protocol='http', custom_client=None, http_request_kwargs=None): self.io_loop = io_loop or IOLoop.instance() self.url = "%(protocol)s://%(host)s:%(port)s" % {"protocol": protocol, "host": host, "port": port} self.bulk = BulkList() self.client = custom_client or AsyncHTTPClient(self.io_loop) # extra kwargs passed to tornado's HTTPRequest class e.g. request_timeout self.http_request_kwargs = http_request_kwargs or {}
def __init__(self, host='localhost', port='9200', io_loop=None, protocol='http'): self.io_loop = io_loop or IOLoop.instance() self.url = "%(protocol)s://%(host)s:%(port)s" % { "protocol": protocol, "host": host, "port": port } self.bulk = BulkList() self.client = AsyncHTTPClient(self.io_loop) self.httprequest_kwargs = { } # extra kwargs passed to tornado's HTTPRequest class