Skip to content

When queuing calls to the main thread which present speech or braille to the user, ensure they are executed immediately. - #72

Merged
LeonarddeR merged 1 commit into
LeonarddeR:mainfrom
jcsteh:immediate
Jul 28, 2026
Merged

When queuing calls to the main thread which present speech or braille to the user, ensure they are executed immediately.#72
LeonarddeR merged 1 commit into
LeonarddeR:mainfrom
jcsteh:immediate

Conversation

@jcsteh

@jcsteh jcsteh commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

By default, functions queued with queueHandler.queueFunction are delayed slightly so that queues can implement rate limiting, filter extraneous events, etc. Any of that has already occurred on the server.
Therefore, on the client, we want output to be presented to the user as soon as possible; there's no benefit in delaying further. This should make speech and braille output from the server feel more responsive.

@jcsteh

jcsteh commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

There are a couple of other places where self._queueFunctionOnMainThread is called. I didn't change those because it's not clear to me that they need immediate processing and this should only be used where it's necessary for user responsiveness.

@LeonarddeR

Copy link
Copy Markdown
Owner

Great to see you contributing here.
Note that I"m currently heavily working on stability improvements, so many things have changed last days. If you would like me to produce a patch in the 1.7.x range, let me know.

… to the user, ensure they are executed immediately.

By default, functions queued with queueHandler.queueFunction are delayed slightly so that queues can implement rate limiting, filter extraneous events, etc.
Any of that has already occurred on the server.
Therefore, on the client, we want output to be presented to the user as soon as possible; there's no benefit in delaying further.
This should make speech and braille output from the server feel more responsive.
@LeonarddeR
LeonarddeR enabled auto-merge (squash) July 28, 2026 05:40
@jcsteh

jcsteh commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Oh, I see you just added a few more calls to _queueFunctionOnMainThread. Not sure if you just pushed those commits or if I missed them somewhere. Anyway, I'm not sure whether those need this treatment or not, but I'd tend to lean towards not doing it unless you think it's absolutely necessary. Note that if you queue a non-immediate call and then queue an immediate call, the immediate will override the non-immediate and cause the queue to run immediately.

@LeonarddeR
LeonarddeR merged commit 3a55eb3 into LeonarddeR:main Jul 28, 2026
2 checks passed
@jcsteh
jcsteh deleted the immediate branch July 28, 2026 05:43
@LeonarddeR

Copy link
Copy Markdown
Owner

I indeed pushed them minutes ago. I got rid of the thread pool executor and addressed nvaccess/nvda#20569

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