title: Threads or state machine to manage application state?
body: <p>I have a web application that automatically configures a device. Communication is achieved in a request - response fashion using HTTP. I am currently using a thread to manage the configuration procedure but it is generally recommended that application threads are not spawned in web servers so my question is should I be using a event based mechanism rather than a thread? are event framework's used to maintain application state or am I thinking about them in the wrong way?  </p>
  
  <p>If there are any more applicable design patterns, I'd love to hear about them.</p>
  
  <p>Thanks a lot.</p>