Debounce input
#1179
Replies: 2 comments 2 replies
-
Python or c++? Do you implement some request limiting? Besides the lag this may also be helpful to avoid rate limiting of the service providers |
Beta Was this translation helpful? Give feedback.
1 reply
-
Imho it makes no sense to apply this to all plugins. Most plugins can start its query instantly and also can be cancelled at any point. Look at aur, wiki, archwiki, etc. They all implement some sort or limiting |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Proposal
Allow configuration of Albert so that the input is debounced for a configurable amount of ms. By "debounced" I mean that the search string inputted to Albert is not sent to the plugins before X ms has passed since the last keystroke.
Context
I want to use Albert launcher for navigating GitLab projects. I wrote a plugin (https://gitlab.com/emilioidk/albert-gitlab) that once I give it an Access Token for GitLab it will call GitLab's API to search projects based on the input string. Before v0.18 of Albert the plugin happened to benefit from what seemed to be debouncing of the input as I was able to keep typing even though the plugin was not done with a search for a substring. I realize now that this approach was a bit wasteful because if I typed "albert" then the plugin would do the search for "alb", "albe", "alber", and "albert" but only would need the results of the last one. From v0.18 of Albert it doesn't seem to be debounced in any way. Now Albert will wait for my plugin to be done with the search before allowing me to input more in my search. As an example look at the video underneath. Typing "gl albert uuid" seems to freeze albert because of the calls being done by the plugin.
Screencast.from.01-17-2023.10.02.25.AM.webm
Would it be possible and sensible to add the ability of debouncing searches?
Beta Was this translation helpful? Give feedback.
All reactions