0

The design brief for my project includes the following:

Be able to spin up new instances of Windows Services at will and attach random message handlers to each for the purpose of logically grouping the handlers along service boundary lines (or any other arbitrary reason to group handlers).

The design we've chosen is to encapsulate a given message TYPE and all of it's handlers into a single assembly (DLL). I am trying to generate subscriptions when the host starts and remove them from Raven when the host stops.

I have success in their creation implementing the IWantToRunWhenBusStartsAndStops interface within a particular message TYPE assembly. The IWantToRunWhenBusStartsAndStops.Start() fires and I add the proper subscription there.

The removal is the issue I am trying to solve. The IWantToRunWhenBusStartsAndStops.Stop() method is only invoked when a control-break is issued manually.

Is there a different interface I should be implementing or a different approach to the issue I should take??

Thanks in advance for your help!

0 Answers0