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

How to make signals trigger subscriptions across multiple dynos/schedulers #22

Open
mukluk opened this issue May 13, 2020 · 2 comments
Open

Comments

@mukluk
Copy link

mukluk commented May 13, 2020

First of, I LOVE your library and have been able to perfectly implement it in my project. I have been planning on scaling up though and am having some thoughts on signals originating from multiple cpus/dynos or perhaps even firing them from a scheduler. Is there a way to have signals trigger subscriptions as per the aforementioned requirements? I was thinking of firing them across channels, but it seems rather complicated and I am still fairly new to python.

What are your thoughts? Help is greatly appreciated. Thank you in advance!

@jaydenwindle
Copy link
Owner

Hey @mukluk! Awesome, glad you like it 😊

graphene-subscriptions actually handles sending events to multiple app instances using Channel Layers automatically. If you use the built-in post_save_subscription and post_delete_subscription signals, an event will be sent via Channel Layers so that all instances with active Subscription connections receive it and send the data to the client. If you're using Custom Events this is also handled automatically.

Does that help?

@mukluk
Copy link
Author

mukluk commented May 13, 2020

Thank you so much for the quick response.

That's good to know. I was running a Heroku Scheduler to run some updating tasks and the signals weren't triggering graphene-subscriptions, so I assumed that they weren't being sent over channels, but this may be a separate issue.

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

No branches or pull requests

2 participants