-
Grisha Kruglov authored
At this point in the stack, we're not in control over what our autocomplete providers are, what actions they'll do in order to field our queries, etc. For example, some providers may hit the disk and perform expensive DB queries internally. Some may even hit the network, in theory! In order to keep things perceptively speedy, let's run the actual work off the main thread. This patch sets up a new pool thread to process autocomplete requests. More than one thread is selected so that we maintain liveliness during quick user input. Background tasks are cancelled as new queries come in, and stale results are discarded.
28da6a5c