-
Notifications
You must be signed in to change notification settings - Fork 920
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
Return queue_empty
for Device::poll
#2643
Conversation
This is great - just half an hour ago, I was thinking about making this exact change. The concern I ran into is this: if the device is shared between threads, another thread could submit a request immediately after your call to If you could intercept all access to the |
There was some discussion about this in the matrix chat. Assuming @xiaopengli89 and I are on the same page: the reason we want this feature is because we'd like to manage polling transparently, in a set-and-forget kind of way. We want to write Further, we'd like to not do dumb things like the current Firefox code (for which I am responsible):
i.e., just poll every once in a while, from a timer. Further, we don't want to follow the example of One solution, if we take this PR, would be to protect all access to the The downsides to this are:
@grovesNL pointed out that #1891 has prior discussion on the same (or at least a closely related) question. |
edd4d0b
to
8f66594
Compare
I think it is an acceptable solution to let user make sure that the device polling is used correctly during the transition period when the automatic device polling feature is not implemented。 |
Thank you! |
Description
queue_empty
can avoid unnecessary device polling.