Skip to main content

Supports gremlinpython without asyncio

Project description

This package helps you use gremlinpython, when you can't use asyncio.

Problem

In some settings, e.g. an eventlet web server with monkey patching, you may run into errors if you try to run code that relies on Python's asyncio framework. (Demonstration here.)

If you want to use gremlinpython in such a setting, then you need an alternative to the built-in AiohttpTransport class.

Solution

This package provides the WebsocketClientTransport class. It relies on the popular websocket-client package, which runs without asyncio.

Usage

from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
from wsc_grempy_transport.transport import websocket_client_transport_factory

remote = DriverRemoteConnection(
    'ws://localhost:8182/gremlin',
    transport_factory=websocket_client_transport_factory)

Development

The WebsocketClientTransport class is very rudimentary. It is essentially just a wrapper for the websocket.WebSocket class, and could probably benefit from some error checking to make it more robust.

Contributions are welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wsc-grempy-transport-0.1.0.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

wsc_grempy_transport-0.1.0-py3-none-any.whl (7.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page