Comments (5)
Hey @dzhlovegithub and thanks for submitting an Issue!
In order to help you out I'll need a few more details:
- What does your code look like?
- 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.
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.
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.
@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.
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)
- Timeout settings? HOT 1
- Websocket configuration is not restored during reconnect HOT 1
- pip install not newest version HOT 1
- after running for hours the timeout become much HOT 1
- Connection Issue HOT 2
- A proper handling of a Bitfinex-initiated connection closing
- how to reconnect properly HOT 3
- ORDER RELATED API HOT 1
- SUBSCRIPTION TO DATA HOT 1
- authenticated channels HOT 4
- New websocket-client release breaking code HOT 1
- client_tests don't work HOT 8
- problems with reconection HOT 3
- Pypi version 1.2.2 breaks `raise_exception` HOT 3
- websockets reconnecting constantly? HOT 2
- the auth_nonce problem
- fail to run client.py ,help HOT 2
- not responding sometimes
- Upcoming Bitfinex API Update June 2019
- Account channel not updated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from btfxwss.