Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow an option for passing "installSignalHandlers" to reactor.run when threaded is set to False in the KiteTicker connect() function #41

Open
h-vishal opened this issue Apr 20, 2018 · 1 comment
Assignees
Labels

Comments

@h-vishal
Copy link

We have a class that manages the ticker thread, with the switch to 3.0 we can't use the KiteTicker class directly because we are not running it in the main thread, and we can't use the threaded option in connect() because this creates a new thread in our ticker thread, which is suppose to block on the connect function.

This is the relevant snippet from the current version of the connect() function -

# Run in seperate thread of blocking
        opts = {}
        if threaded:
            # Signals are not allowed in non main thread by twisted so supress it.
            opts["installSignalHandlers"] = False
            self.websocket_thread = threading.Thread(target=reactor.run, kwargs=opts)
            self.websocket_thread.daemon = True
            self.websocket_thread.start()
        else:
            reactor.run(**opts)

Ideally we would like an input flag on the connect function to be able to set the "installSignalHandlers" in the else clause in the above snippet.

@vividvilla vividvilla self-assigned this Feb 17, 2021
@hemangjoshi37a
Copy link

This is very nice idea. I hope this get PRed in the main repo. nice idea @h-vishal

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

No branches or pull requests

3 participants