title: How to do event driven programming between 2 separate C# programs?
body: <p>How to fire up event from a separate C# program?</p>
  
  <p>The C# program I am working on has two separate components: Task Creator (TC) and Task Processor (TP). TC is attached to a web service that constantly inserts new tasks into a database table. On the other hand TP reads from the same table and processes each tasks then updates the status back to the same table. It’s almost like a queue but done using database rather than e.g. MSMQ. Every 5 seconds TP wakes up and reads from the table to check for unprocessed tasks however this has some performance impacts. When there’s no new tasks it’s a bit of waste to fire up a select from where SQL statement. The ideal way is to have some kind of notification method that when new tasks are inserted TP will get notified and then wakes up from its dream to check for new tasks. </p>
  
  <p><strong>Current solution:</strong></p>
  
  <p><a href="http://yuml.me/3b49bcfd" rel="nofollow noreferrer">diagram of current solution http://yuml.me/3b49bcfd</a></p>
  
  <p><strong>Ideal solution:</strong></p>
  
  <p><a href="http://yuml.me/5cf843a5" rel="nofollow noreferrer">diagram of idealsolution http://yuml.me/5cf843a5</a></p>