Open terussell85 opened 2 years ago
I am working on async aspects of this, at first doing some kind of async version of adafruit_requests
. We may need to add non-blocking primitives to radio
: I haven't yet looked at that level, still choosing the API for the user library.
just curious if there's been any progress on async versions of wifi.radio.connect
or adafruit_requests
? or if there's any workarounds for making async networking requests.
I started a fork in the adafruit_requests library: https://github.com/dhalbert/Adafruit_CircuitPython_Requests/tree/async. I think someone used it successfully (perhaps with some changes), even though I hadn't even tried it in any way yet.
Any update on making this non-blocking per the OP?
Adding my vote as well. Blocking on request is one of the core use cases for async.
Is anyone interested in working on this as well as an async API for adafruit_requests
? I would like to sponsor the work. Mention me here or ping me via email (see profile).
Adding my vote - want to run some idle animations while the radio is connecting, etc.
With the recent introduction of
asyncio
, it has allowed great simplification of simultaneous code loops for things like animations or playing audio.However, the interface to
wifi.radio.connect
is still fully blocking. I might be missing other options, but as far as I can tell, this makes doing things like animations or sounds impossible while wifi connections are in progress. At least for singular integrated chips (not using coprocessors).Ideally I'd be able to
await wifi.radio.connect
so that I can release the thread for NeoPixel animations or other items.