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

Add example for polling with reswap and HttpResponseStopPolling #412

Closed
wants to merge 2 commits into from

Conversation

fdemmer
Copy link

@fdemmer fdemmer commented Jan 16, 2024

Thank you for another useful, little package for Django, Adam! ❤️

Clicking through the examples after reading the docs, I thought maybe a demo for a timed trigger and HTTP 286 (without swapping!) would be a good addition.

@adamchainz
Copy link
Owner

Thanks for the suggestion. Using a global variable isn’t safe, because it shares state between all “countdown” processes. After trying to refactor the demo not to use it, I realized we also don’t need reswap - no need for an iterator and StopIteration check when we can just use a list index and check if it’s the last. So I don’t think this demo provides much value, at least for general use. Probably better as a blog post, if you want to write it up. Thanks!

@adamchainz adamchainz closed this Aug 5, 2024
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

Successfully merging this pull request may close these issues.

2 participants