Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Websockets is under documented, i'm having trouble using it #78

@jerrydboonstra

Description

@jerrydboonstra

I'm having trouble using the Websockets feature support.

If there were enhanced docs, or a strong example, or test case that would help alot.

  • I cannot figure out how to easily override the various callback methods from their toy versions in the Websocket wrapper object. This is required if we want to do stuff like store message output into databases or queues.
  • managing the thread has been difficult in my configuration (Flask and in GCP Cloud Run remotely) and I'm having trouble with workarounds.

The best progress I made was running the pybit/test.py file which I found browsing the code. This seems like a leftover prototype for the Websockets class that exists, but it gives me some output that works.

Part of the problem could be that I'm running it as part of a Flask application, and managing the background thread is problematic. I'm narrowing in on a solution of running it in Cloud Run as its own application but that requires using some background persistence like Redis: https://cloud.google.com/run/docs/triggering/websockets

Alternatively, I've played with https://kendhia.medium.com/run-python-webserver-flask-as-a-websocket-client-also-175c130f7ca4 to run multiple processes together but it hasn't come together yet.

Any enhanced docs, or a strong example, or test case that would help alot. As I explore this on my own side I will try to contribute back.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions