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

Can't Ctrl+C to exit the event loop #338

Open
johhnry opened this issue Sep 16, 2024 · 3 comments
Open

Can't Ctrl+C to exit the event loop #338

johhnry opened this issue Sep 16, 2024 · 3 comments
Assignees
Labels

Comments

@johhnry
Copy link

johhnry commented Sep 16, 2024

Context

Studio name: Welcome To Love
Gazu version: 0.10.14
Zou installation type: self-hosted

Describe the bug
I am following the event tutorial page: https://gazu.cg-wire.com/events

I can't do Ctrl+C in the terminal to exit properly the event loop listening using gazu.events.run_client.

Expected behavior
It should handle the Ctrl+C signal and exit. It might be related to the python-socketio[client] library in socketio.Client.wait function.

For now I am closing the terminal tab but it's not really ideal in dev mode.

Code

gazu.set_host("https://kitsu.mystudio.com/api")
gazu.set_event_host("https://kitsu.mystudio.com")
gazu.log_in("email", "password")


def my_callback(data):
    print("Asset created %s" % data["asset_id"])

event_client = gazu.events.init()
gazu.events.add_listener(event_client, "asset:new", my_callback)
gazu.events.run_client(event_client)

Additional context
Platform: Windows

@johhnry
Copy link
Author

johhnry commented Sep 17, 2024

It may be related to Windows only because I tested it inside a Docker container and Ctrl+C worked...

@frankrousseau
Copy link
Contributor

@johhnry
Copy link
Author

johhnry commented Sep 19, 2024

@frankrousseau I found the corresponding issue on python-socketio: miguelgrinberg/python-socketio#570

miguelgrinberg/python-socketio#570 (comment)

Not planning to add custom interrupt handler for Windows at this time, given that it is possible to disable the UNIX-friendly handler that is provided and install a custom one as shown above.

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