Skip to content

Instantly share code, notes, and snippets.

@phatboyg
Created February 28, 2010 00:43
Show Gist options
  • Save phatboyg/317084 to your computer and use it in GitHub Desktop.
Save phatboyg/317084 to your computer and use it in GitHub Desktop.
internal class Program
{
private static void Main(string[] args)
{
RunConfiguration configuration = RunnerConfigurator.New(x =>
{
x.SetServiceName("CalebMailService");
x.SetDisplayName("Caleb's Mail Service");
x.SetDescription("Give you some sexy mail service");
x.ConfigureService<MaleService>(c =>
{
c.HowToBuildService(y => new MaleService());
c.WhenStarted(s => s.Start());
c.WhenStopped(s => s.Stop());
});
});
Runner.Host(configuration, args);
}
public class MaleService
{
public void Start()
{
Console.WriteLine("Starting...");
}
public void Stop()
{
Console.WriteLine("Stopping...");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment