title: Last result of heavy processing of stream of events
body: <p>There is a stream of events being processed by a costly algorithm which executes for a very long time. Results for all events except last (at every moment) are of no interest. I want to process an event asynchronously interrupting processing of previous events each time a new one arrives.</p>
  
  <p>Are there any good patterns or techniques to do so?</p>
  
  <p>I've considered:</p>
  
  <ul>
  <li>actors (no cancellation)</li>
  <li>futures (no cancellation)</li>
  <li>threads (not clear how should last event be selected, and they are usually heavy)</li>
  <li>thread pools (require custom solution, not Scala way?)</li>
  </ul>
  
  <p>I tend to choose pools, with a custom interruptible tasklet (not yet designed). Are there better options in Scala? If not how should I implement my tasklet?</p>