title: implementing auto suggestions on every key pressed
body: <p>I am implementing a text box with an auto suggest values which takes values from mysql database on every key pressed.As i have large set of values in database,my functions takes time.Moreover each call to a function is run sequentially</p>
  
  <p>Suppose
  I pressed A key,which triggers an event and execution of func starts.
  Then i pressed B key,which again triggers an event but now i want earlier func should be killed before running the second function</p>
  
  <p>How can i achieve this??</p>
  
  <p>On searching through i found threading can be used to implement this.But still i wasnt able to implement even through threads.If someone know the exact procedure?</p>