This helper function would block until an already open GPIO or set of GPIOs has the specified value.
The motivation for this is that this comes up periodically in synchronous code that needs to wait for a pin that signifies device busy. Asynchronous code has no problems with this use case since it can just subscribe to the GPIO and react to value change notifications. With synchronous code, the easiest thing to do is to poll the pin every millisecond or so. Polling isn't ideal for long waits and converting this code to subscribe to change notifications turns out to be easy to get subtly wrong.
This helper function would block until an already open GPIO or set of GPIOs has the specified value.
The motivation for this is that this comes up periodically in synchronous code that needs to wait for a pin that signifies device busy. Asynchronous code has no problems with this use case since it can just subscribe to the GPIO and react to value change notifications. With synchronous code, the easiest thing to do is to poll the pin every millisecond or so. Polling isn't ideal for long waits and converting this code to subscribe to change notifications turns out to be easy to get subtly wrong.