compose-net / compose

Lightweight framework to assist in application composition
Apache License 2.0
6 stars 6 forks source link

Service Host should deal with Azure/Windows envrionments #19

Open mattridgway opened 9 years ago

mattridgway commented 9 years ago

To make the code more implicit we should change the service host extension methods so that composition looks like the following:

//Thread falls through after it has run, service would stop app.OnStart(projector => projector.Receive).ThenStop(); app.OnStop(projector => projector.Dispose);

//Thread is held after it has run, like listening for new event from hub app.OnStart(projector => projector.Receive).ThenBlock(); app.OnStop(projector => projector.Dispose);

//everytime it finishes it loops around and starts again app.OnStart(projector => projector.Receive).ThenLoop(); app.OnStop(projector => projector.Dispose);

smudge202 commented 9 years ago

This should be pretty easy to accomplish. Basically, by default we'd expose the CancellationToken, but the helpers can manage the token in order to provide the above extensions.

+1

smudge202 commented 9 years ago

This needs to be moved to smudge202/compose-azurecloudservice