Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

Error in Readme example execution #39

Closed
Leobouloc opened this issue Sep 7, 2017 · 2 comments
Closed

Error in Readme example execution #39

Leobouloc opened this issue Sep 7, 2017 · 2 comments

Comments

@Leobouloc
Copy link

I get the following error when running the example in the README:

>>> wss.conn.wait()
Traceback (most recent call last):

  File "<ipython-input-6-972ef3cfd4a6>", line 1, in <module>
    wss.conn.wait()

AttributeError: 'WebSocketConnection' object has no attribute 'wait'

If I replace this line by a time.sleep(60), i get the following error:

>>> wss.subscribe_to_ticker('BTCUSD')
ERROR:btfxwss.client:Cannot call subscribe_to_ticker() on unestablished connection!
INFO:btfxwss.connection:Connection Error - [Errno 110] Connection timed out
INFO:btfxwss.connection:Connection closed
INFO:btfxwss.connection:Attempting to connect again in 10 seconds.
INFO:btfxwss.connection:Connection opened
INFO:btfxwss.connection:Connection closed

Any ideas ?

@sebick
Copy link

sebick commented Sep 7, 2017

while not wss.conn.connected.is_set():
    time.sleep(1)

Hey, 60s is way too long, you probably have a timeout before you even try to subscribe. Those two lines achieve what is actually intended.

deepbrook pushed a commit that referenced this issue Sep 8, 2017
@rterbush
Copy link

rterbush commented Sep 9, 2017

PR #43 fixes this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants