Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Topshelf HostConfigurator #6

Merged

Conversation

@igitur
Copy link
Contributor

igitur commented Feb 5, 2020

Draft proposal to expose Topshelf's HostConfigurator.


Rebus is MIT-licensed. The code submitted in this pull request needs to carry the MIT license too. By leaving this text in, I hereby acknowledge that the code submitted in the pull request has the MIT license and can be merged with the Rebus codebase.

@claassistantio

This comment has been minimized.

Copy link

claassistantio commented Feb 5, 2020

CLA assistant check
All committers have signed the CLA.

@mookid8000 mookid8000 merged commit 3408cd9 into rebus-org:master Feb 5, 2020
1 check passed
1 check passed
license/cla Contributor License Agreement is signed.
Details
@mookid8000

This comment has been minimized.

Copy link
Member

mookid8000 commented Feb 5, 2020

Hi @igitur , thanks for the PR!

I've merged it, but when I realized that there was already a configuration callback, Configure(...), on ServiceConfiguration looking like this:

var configuration = new ServiceConfiguration()
    .Configure(c =>
    {
        c.EnableParallelStartup();
        c.EnableParallelShutdown();
    })
    .Add("test1", () => new TestService1())
    .Add("test2", () => new TestService2());

ServiceHost.Run(configuration);

I decided to move your Topshelf customizer into HostSettings, which means that the Topshelf host settings must be set within the callback.

Moreover, I renamed it to Topshelf – dunno if this is super-good, but it kinda signals that it's relevant only for Topshelf.... with these changes, a configuration could look like this:

var configuration = new ServiceConfiguration()
    .Configure(c =>
    {
        c.EnableParallelStartup();
        c.EnableParallelShutdown();

        c.Topshelf(config =>
        {
            config.SetDescription("Some description");
            config.EnableServiceRecovery(r => r.RestartService(5));
        });
    })
    .Add("test1", () => new TestService1())
    .Add("test2", () => new TestService2());

ServiceHost.Run(configuration);

What do you think about that?

@igitur igitur deleted the igitur:expose-topshelf-hostconfigurator branch Feb 5, 2020
@igitur

This comment has been minimized.

Copy link
Contributor Author

igitur commented Feb 5, 2020

@mookid8000 Perfect, thanks!

@mookid8000

This comment has been minimized.

Copy link
Member

mookid8000 commented Feb 5, 2020

Cool! I've released it as Topper 3.2.0 now 🙂 it should be visible on NuGet.org in a few minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.