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

Introduced DI #25

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open

Introduced DI #25

wants to merge 28 commits into from

Conversation

lsfera
Copy link
Contributor

@lsfera lsfera commented Jul 5, 2024

Superseeded by #28!

Exposed AddBlumchen() capability.

Verify demo project SubscriberWorker for usage

closes #15

@@ -0,0 +1,49 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIX: Let's merge it into the regular project. I'm fine with having hosting.abstractions and Polly dependency in the main project. It's much more accessible when user installs just a package and have all available (of course, unless that's enforcing too much from the peer dependency side).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've no strong opinion against it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lsfera, could you change that in the PR?

var builder = Host.CreateApplicationBuilder(args);

builder.Services
.AddBlumchen<SubscriberWorker<UserCreatedContract>, UserCreatedContract>()
Copy link
Collaborator

@oskardudycz oskardudycz Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CONCERN: Does that mean that we need to call AddBlumchen for Contracts separately? My preference would be to have a single AddBlumchen with additional lambda as param for configuring dependencies. See example how we did it in Marten: https://martendb.io/configuration/hostbuilder.html#bootstrapping-marten.

It should also register all needed default configurations allowing user to override that later on.

Copy link
Collaborator

@oskardudycz oskardudycz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lsfera see the comments, but that's a nice first step to have it.

@lsfera lsfera marked this pull request as draft July 16, 2024 09:05
@lsfera lsfera marked this pull request as ready for review July 16, 2024 17:30
@lsfera lsfera requested a review from oskardudycz July 16, 2024 17:32
@lsfera lsfera changed the title Introduced DI as complementary project/nupkg Introduced DI Jul 21, 2024
@@ -74,10 +73,9 @@ public SubscriptionOptionsBuilder WithReplicationOptions(ReplicationSlotManageme
}

[UsedImplicitly]
public SubscriptionOptionsBuilder Consumes<T, TU>(TU consumer) where T : class
where TU : class, IConsumes<T>
public SubscriptionOptionsBuilder Consumes<T>(IHandler<T> handler) where T : class
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

COMMENT: In the long term I'd also like to allow handlers that don't use marker interfaces, but that's something to tackle in the dedicated PR.

Copy link
Collaborator

@oskardudycz oskardudycz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lsfera, thank you for including my suggestions and the hard work. I'm fine with pulling that in after merging the dependency injection project with the regular one. 👍

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

Successfully merging this pull request may close these issues.

Consider using Polly or Microsoft Resilience package for retry policies in delivering messages
2 participants