Skip to content
Advertisement

Tag: python-multithreading

Python Websocket-Client Package Frequent Ping-Pong Timeouts Upon Too Many Subscriptions

I am using the python websocket-client package (https://pypi.org/project/websocket-client/) to subscribe to multiple websocket channels. I implemented the basic ping-pong logic using the websocket client package as below. The ping-pong logic is working mostly fine under normal circumstances and I am able to run the code for hours without many disconnect/reconnect instances. However, when I try to increase the number of

How can I prevent other threads from running when a certain condition is met?

I created a situation in which two threads run continuously. My intention is to prevent all other threads from running when the “Printing Alphabet” portion of the “printAlphabet” function is entered, and when this prioritized thread is done running, all threads resume execution until the condition is met again. The “anotherThread” function continues to run even when this section is

Multithreading on object methods in python

I am trying to implement multi threading with oops But the test1.printHi is expecting me to pass self After passing self it is not being multi threaded any more It Its first printing all hi and then hello at last next is getting printed but when I implement them like functions its working properly they are getting printed at once

pass function from class without starting it python

I need to run two functions with the threading module you’re able to do this Thread(target=my_func) but i want the function from a class (imported class) so i tried Thread(target=a_class.my_func) but it didn’t worked, then i tried Thread(target=a_class.my_func()) but this one starts to run the function because i called it , and this is an infinite loop so the next

Advertisement