Giter VIP home page Giter VIP logo

Comments (5)

deepbrook avatar deepbrook commented on August 27, 2024

Hey @dzhlovegithub and thanks for submitting an Issue!
In order to help you out I'll need a few more details:

  1. What does your code look like?
  2. Provide the log calls after you ran your code.
    To provide the log calls, simply upload the log file. To enable logging to file, add the following code:
import logging
logging.basicConfig(filename="btfxwss.log", level=logging.DEBUG)

wss = BtfxWss(key, secret, log_level=logging.DEBUG)
...

Thanks!

from btfxwss.

sebick avatar sebick commented on August 27, 2024

Hello @nlsdfnbch,

I may have a related problem, when trying to establish a long-running websocket connection. I'm not sure if it is intentional or not, but at the moment it seems that the client does not resubscribe to the same channels it was connected to before a timeout or disconnect happened. No subscribed channel leads to endless reconnects due to timeouts. Is this behavior intended or do you consider an automatic renewal of subscriptions?

My problem is that I don't have/know a method to decide the moment I need to resubscribe to channels after a disconnect, without changing your code.

from btfxwss.

deepbrook avatar deepbrook commented on August 27, 2024

Hey @8ick and thanks for reaching out!
It is true that the client does not automatically re-subscribe to channels if the connection drops. This was implemented in early versions, but continuously led to unexpected behaviour and errors.
However, it is certainly on the to-do list. Unfortunately I cannot give you an exact ETA for it - at the very earliest I will be able to give it a shot in roughly two weeks. Sorry :/

from btfxwss.

sebick avatar sebick commented on August 27, 2024

@nlsdfnbch
Do you have a recommendation how to catch a reconnect at the moment? I used a timer and tried re-subscribing if no new data was received in the last 120s or so, but from what I have seen in the newest version, the client does not tell/return if the subscription was sucessful or not.

Anyway, thanks a lot for your work here.

from btfxwss.

deepbrook avatar deepbrook commented on August 27, 2024

It should tell you - in queue_processor.py at line 134, the _handle_subscribed() method should be doing this. However, this has been Human-readable only. So raising a TimeOutError upon the second or third reconnect may be a possibility.

As far as the temporary fix goes, you can try to handle this yourself, but it will require some programming:

in connection.py, line 316, the method _system_handler()takes care of re-issuing a connection. In this method you'll have to pass a message up to the QueueProcessor using pass_to_client() to tell it to re-send all subscription messages after the restart.
Since the QueueProcessor object doesn't store subscribe calls, you will have to add this as well, so that when a message from Connection with a re-subscribe message arrives it can re-send the messages without bothering the user about it.

from btfxwss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.