-
Notifications
You must be signed in to change notification settings - Fork 826
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
Use of command palette cancels previously-running non-thread workers #3615
Comments
Hat tip to @otherjason for reporting this. Bumping straight to the todo list as it's a bit of a show-stopper. |
As mentioned in the discussion, I would suspect that: self.workers.cancel_all() is doing more than I expected it to (I expected Also, in retrospect, it might make sense to ensure that any worker in the command palette is in an "internal" group of some sort? |
Having And I guess you're right in that it makes sense to have the command palette workers have an internal group of some sort. |
You'd probably want to use either |
Yeah, that's a very curious choice. I wonder if we should review that? |
See Textualize#3615. Co-authored-by: Rodrigo Girão Serrão <[email protected]>
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Discussed in #3613
Originally posted by otherjason October 30, 2023
I have an app that uses several long-lived workers to asynchronously poll external services for data and update the UI. I found that closing the command palette, either via
ESC
or by selecting a command, seems to cancel any pending workers. Here's a small example:When running the above, it will print a new line to the
RichLog
every second. If you open the command palette, then the worker stays running. But it seems that after the palette comes up, as soon as I press a key, the worker stops running.Is this behavior intended, or is this a bug?
The text was updated successfully, but these errors were encountered: