Skip to content

Split serve_forever to allow polling in loop and add another example with polling in while loop. #7

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

Merged
merged 4 commits into from
Jul 6, 2022

Conversation

karlfl
Copy link
Contributor

@karlfl karlfl commented Jul 2, 2022

I split out the logic from the serve_forever into two methods start() and poll(). This will allow developers to do other work in the while loop while still processing the web requests. The original method now calls these two methods so that any existing code will still work. Tested it using both of the existing examples and added a third that implements the start() and poll() functions.

@tekktrik tekktrik requested a review from a team July 5, 2022 23:18
@TheKitty TheKitty requested a review from tannewt July 5, 2022 23:46
Copy link
Contributor

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this nice upward-compatible alternative!

@dhalbert dhalbert merged commit 142c97d into adafruit:main Jul 6, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jul 6, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 1.12.8 from 1.12.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#62 from tom24/udpfixes

Updating https://github.com/adafruit/Adafruit_CircuitPython_Dash_Dis to 1.1.7 from 1.1.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_Dash_Dis#5 from Neradoc/add-requirements

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Shapes to 2.5.0 from 2.4.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Shapes#50 from bablokb/sparkline_opt

Updating https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer to 0.2.0 from 0.1.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_HTTPServer#7 from karlfl/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_OAuth2 to 1.0.10 from 1.0.9:
  > Merge pull request adafruit/Adafruit_CircuitPython_OAuth2#8 from tcfranks/main
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