title: Running multiple use-cases on Streaming Data
body: <p>I'm getting streaming sensor data from Kafka, and I need to do the following:</p>
  
  <p>a. Check a variable's variations within a time period, and if extreme raise an alarm (e.g. temperature variations over a 5 min period from very low to very high). I check if I get a very low temp, set a timer of 5 mins and observe if I get a very high temp within 5 mins, and if so I raise an alarm</p>
  
  <p>b. Alternatively, if I get a high temp, then I check to see if I get a very low temp in the 5-min window</p>
  
  <p>c. compute the running average of temperature every 1-min and push to kafka. This is a continuous activity and I need a timer from the start running every 1-min on an incremental basis</p>
  
  <p>I'm not able to understand how to make use of the timer for all these use-cases in the same code. Any suggestions / advice.</p>