diff --git a/README.md b/README.md index d3e03ba58e3010fa7d31b528ab875a2074573b44..eb2d649f2e3cd9103b60011007be0105d92b4211 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,10 @@ The Gremlin Server responds with messages in chunks, `GremlinClient.submit` subm >>> loop = asyncio.get_event_loop() >>> gc = GremlinClient('ws://localhost:8182/', loop=loop) # Or even better, use the constructor function. This will init pool connections. ->>> gc = create_client('ws://localhost:8182/', loop=loop) +# ***Must be done inside a coroutine*** +>>> gc = yield from create_client('ws://localhost:8182/', loop=loop) +# Or outside of a coroutine using the loop to help +>>> gc = loop.run_until_complete(create_client(loop=loop)) # Use get. >>> @asyncio.coroutine diff --git a/README.txt b/README.txt index f19f4195f1ea9b81b9aab7a4df2894c15a918cb8..68949bf7a3290ab6d8d4decea5e85bc714c73374 100644 --- a/README.txt +++ b/README.txt @@ -1,6 +1,6 @@ -==================================================== +========================================================= aiogremlin - Async Python 3 driver for TP3 Gremlin Server -==================================================== +========================================================= **alpha** @@ -8,4 +8,4 @@ aiogremlin - Async Python 3 driver for TP3 Gremlin Server `Official Documentation`_ -.. _Official Documentation: +.. _Official Documentation: https://github.com/davebshow/aiogremlin diff --git a/benchmark.py b/benchmark.py index 894f2fd28f35747a830fca1c8eb75cb1a23cf280..20ac929cfc91303ebb4f96c6982ddc60c6e0e49c 100644 --- a/benchmark.py +++ b/benchmark.py @@ -3,8 +3,6 @@ https://github.com/KeepSafe/aiohttp/blob/master/benchmark/async.py """ import argparse import asyncio -import collections -import random import aiogremlin @@ -20,9 +18,9 @@ def run(client, count, concurrency, loop): for x in range(count): try: t1 = loop.time() - resp = yield from execute("1 + 1") + resp = yield from execute("%d" % x) assert resp[0].status_code == 200, resp[0].status_code - assert resp[0].data[0] == 2, resp[0].data[0] + assert resp[0].data[0] == x, resp[0].data[0] t2 = loop.time() processed_count += 1 except Exception: