Wes Posted November 9, 2013 Share Posted November 9, 2013 Is there any way to know within a script that the user is still typing, or another query has already been sent to the script? The problem is that some scripts connect to a website api and this causes a significant lag with all the requests being sent for every keystroke. Or is there some way to only send the input to the script when enter is pressed or no keys have been pressed in 1 second? (per script configurable) Thanks. Link to comment
Andrew Posted November 9, 2013 Share Posted November 9, 2013 Is there any way to know within a script that the user is still typing, or another query has already been sent to the script? The problem is that some scripts connect to a website api and this causes a significant lag with all the requests being sent for every keystroke. Or is there some way to only send the input to the script when enter is pressed or no keys have been pressed in 1 second? (per script configurable) Thanks. Alfred is more clever than this, he won't send subsequent requests to a website if the previous one hasn't returned. If a user types 'a' and while the website is slow at responding, they subsequently type 'ndrew', the second request to the website will be 'andrew'... not 5 requests of 'an', 'and', 'andr', andre', 'andrew'. Cheers, Andrew Link to comment
Wes Posted November 10, 2013 Author Share Posted November 10, 2013 Hi Andrew, thanks for the explanation. Nevertheless, for website API's that are slow to respond, and with a large search query, you are looking at a lot of lag. It seems that the script that handled the previous query should be killed instead of waiting for it's response, before then handling the next query, and the possible next query. Or as I said, some workflow preference to only handle the input after enter has been pressed. Link to comment
Tyler Eich Posted November 11, 2013 Share Posted November 11, 2013 You might be interested in this thread on throttling script filters. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now