Coder Social home page Coder Social logo

Comments (13)

gborrageiro avatar gborrageiro commented on June 16, 2024 1

from websocket-client.

gborrageiro avatar gborrageiro commented on June 16, 2024 1

It looks like your suggestions have worked perfectly, @bubbleboy14 .
Thanks again, as this has saved me a load of time.

By the way, when I installed websockets-client via pypi (I use miniconda), running

pip install websockets-client

installed a 2010 version, 0.53 release.

I only noticed the old release as more recent parameters which are shown in the documented examples, didn't work.
It was only when I ran the following, that I could install the latest 1.6.1 version:

pip install websocket-client[test, optional]

from websocket-client.

bubbleboy14 avatar bubbleboy14 commented on June 16, 2024

Hello @gborrageiro.

The first thing I notice is that "rel.abort()" is your first line - you probably don't need or want that there.

If the purpose of the threading.Timer() is to call a function periodically, you can accomplish that with rel.timeout() - here's what the threading.Timer part would look like with rel.timeout():

rel.timeout(24 * 60 * 60 - 60, self.subscriptions)

And the "self.subscriptions" function should return True, which basically tells rel to reschedule it.

LMK how it goes!

from websocket-client.

gborrageiro avatar gborrageiro commented on June 16, 2024

from websocket-client.

gborrageiro avatar gborrageiro commented on June 16, 2024

from websocket-client.

bubbleboy14 avatar bubbleboy14 commented on June 16, 2024

Yes, you can set up as many timeouts as you want, with whatever intervals.

Ok, so periodically you're resubscribing with a slightly different URL. My recommendation is to manually teardown/close the old WebSocketApp before creating a new one, rather than calling rel.abort().

LMK how it goes!

from websocket-client.

engn33r avatar engn33r commented on June 16, 2024

@gborrageiro I am confused why release 0.53 was installed with the install command you shared. If you have any more information about how that happened, it might help explain some recent issues this month from conda users. This conda repo may be related.

from websocket-client.

gborrageiro avatar gborrageiro commented on June 16, 2024

from websocket-client.

engn33r avatar engn33r commented on June 16, 2024

@gborrageiro Thanks for the update. When I tried to replicate with:

conda create -n my_env python=3.10 -y
pip install websocket-client

websocket-client version 1.6.1 was installed. So I expect the issue is either in the requirements.txt or your pip configuration.

One last clarification: you are writing websockets-client in your posts, but this project is websocket-client (no "s" after socket). If your install commands used websockets-client (with "s") then there could be some typosquatting involved

from websocket-client.

gborrageiro avatar gborrageiro commented on June 16, 2024

from websocket-client.

gborrageiro avatar gborrageiro commented on June 16, 2024

from websocket-client.

gborrageiro avatar gborrageiro commented on June 16, 2024

from websocket-client.

engn33r avatar engn33r commented on June 16, 2024

@gborrageiro thanks I opened an issue on that other project

from websocket-client.

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.