Commit 14d5ad63 authored by davebshow's avatar davebshow
Browse files

allow passing of conn_timeout directly to GremlinClient

parent 341e665c
# [aiogremlin 0.1.0](https://pypi.python.org/pypi/aiogremlin/0.0.11)
# [aiogremlin 0.1.3](https://pypi.python.org/pypi/aiogremlin/0.0.11)
## [Official Documentation](http://aiogremlin.readthedocs.org/en/latest/)
......
......@@ -26,10 +26,12 @@ class GremlinClient:
"gremlin-groovy" by default
:param str op: Gremlin Server op argument. "eval" by default.
:param str processor: Gremlin Server processor argument. "" by default.
:param float timeout: timeout for establishing connection (optional).
:param float timeout: timeout for websocket read (seconds)(optional).
Values ``0`` or ``None`` mean no timeout
:param ws_connector: A class that implements the method ``ws_connect``.
Usually an instance of ``aiogremlin.connector.GremlinConnector``
:param float conn_timeout: timeout for establishing connection (seconds)
(optional). Values ``0`` or ``None`` mean no timeout
:param username: Username for SASL auth
:param password: Password for SASL auth
"""
......@@ -37,7 +39,7 @@ class GremlinClient:
def __init__(self, *, url='http://localhost:8182/', loop=None,
lang="gremlin-groovy", op="eval", processor="",
timeout=None, ws_connector=None, client_session=None,
username="", password=""):
conn_timeout=None, username="", password=""):
self._lang = lang
self._op = op
self._processor = processor
......@@ -50,7 +52,8 @@ class GremlinClient:
self._password = password
if ws_connector is None:
ws_connector = GremlinConnector(loop=self._loop,
client_session=client_session)
client_session=client_session,
conn_timeout=conn_timeout)
self._connector = ws_connector
@property
......@@ -355,6 +358,7 @@ def submit(gremlin, *,
timeout=None,
session=None,
loop=None,
conn_timeout=None,
username="",
password=""):
"""
......@@ -378,6 +382,8 @@ def submit(gremlin, *,
:param loop: :ref:`event loop<asyncio-event-loop>` If param is ``None``,
`asyncio.get_event_loop` is used for getting default event loop
(optional)
:param float conn_timeout: timeout for establishing connection (seconds)
(optional). Values ``0`` or ``None`` mean no timeout
:param username: Username for SASL auth
:param password: Password for SASL auth
:returns: :py:class:`aiogremlin.client.GremlinResponse` object
......@@ -387,7 +393,8 @@ def submit(gremlin, *,
loop = asyncio.get_event_loop()
connector = aiohttp.TCPConnector(force_close=True, loop=loop,
verify_ssl=False)
verify_ssl=False,
conn_timeout=conn_timeout)
client_session = aiohttp.ClientSession(
connector=connector, loop=loop,
......
......@@ -13,8 +13,8 @@ class GremlinConnector(WebSocketConnector):
"""Create and manage reusable websocket connections. Out of the box
support for multiple enpoints (databases).
:param float conn_timeout: timeout for establishing connection (optional).
Values ``0`` or ``None`` mean no timeout
:param float conn_timeout: timeout for establishing connection (seconds)
(optional). Values ``0`` or ``None`` mean no timeout
:param bool force_close: close websockets after release
:param int limit: limit for total open websocket connections
:param aiohttp.client.ClientSession client_session: Underlying HTTP
......
......@@ -12,7 +12,7 @@ based on the `asyncio`_ and `aiohttp`_ libraries.
Releases
========
The latest release of :py:mod:`aiogremlin` is **0.1.2**.
The latest release of :py:mod:`aiogremlin` is **0.1.3**.
Requirements
......
......@@ -58,7 +58,7 @@ read the chunked responses one at a time::
:param str processor: Gremlin Server processor argument. "" by default.
:param float timeout: timeout for establishing connection (optional).
:param float timeout: timeout for websocket read (seconds)(optional).
Values ``0`` or ``None`` mean no timeout
:param str session: Session id (optional). Typically a uuid
......@@ -67,8 +67,11 @@ read the chunked responses one at a time::
`asyncio.get_event_loop` is used for getting default event loop
(optional)
:param float conn_timeout: timeout for establishing connection (seconds)
(optional). Values ``0`` or ``None`` mean no timeout
:param username: Username for SASL auth
:param password: Password for SASL auth
:returns: :py:class:`aiogremlin.client.GremlinResponse` object
......
......@@ -3,7 +3,7 @@ from setuptools import setup
setup(
name="aiogremlin",
version="0.1.2",
version="0.1.3",
url="",
license="MIT",
author="davebshow",
......@@ -13,7 +13,7 @@ setup(
packages=["aiogremlin", "tests"],
install_requires=[
"aiohttp==0.18.4",
"aiowebsocketclient==0.0.4"
"aiowebsocketclient==0.0.5"
],
test_suite="tests",
classifiers=[
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment