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

Move publishStrategy to method argument #88

Closed
awaniak opened this issue Mar 29, 2023 · 5 comments
Closed

Move publishStrategy to method argument #88

awaniak opened this issue Mar 29, 2023 · 5 comments

Comments

@awaniak
Copy link
Contributor

awaniak commented Mar 29, 2023

Hi
I would want to use the mediator publish method with different publish strategies. Right now it is problematic - one must create different mediator implementations with different publish strategies. I am suggesting adding publish method with publishStrategy argument:
Mediator

    suspend fun <T : Notification> publish(
        notification: T,
        publishStrategy: PublishStrategy = StopOnExceptionPublishStrategy()
    )

MediatorImpl

    override suspend fun <T : Notification> publish(
        notification: T,
        publishStrategy: PublishStrategy,
    ) = processPipeline(
        registry.getPipelineBehaviors(),
        notification
    ) {
        publishStrategy.publish(notification, registry.resolveNotificationHandlers(notification.javaClass))
    }

Let me know, what you think
Cheers

@osoykan
Copy link
Collaborator

osoykan commented Mar 30, 2023

Hi @awaniak, that makes sense, indeed. Thanks for the suggestion. Would you like to create a PR for that?

@awaniak
Copy link
Contributor Author

awaniak commented Apr 4, 2023

Yeah, sure I will prepare something.

@awaniak
Copy link
Contributor Author

awaniak commented Apr 4, 2023

@osoykan Can't push a branch to the repo:

remote: Permission to Trendyol/kediatR.git denied to awaniak.
fatal: unable to access 'https://github.com/Trendyol/kediatR.git/': The requested URL returned error: 403

I wanted to push my branch and create a PR
Can you help me with this?

@osoykan
Copy link
Collaborator

osoykan commented Apr 4, 2023

@awaniak, the recommended approach is forking the repository and sending a PR afterward. You would have full access to the repository after you fork it.

@osoykan
Copy link
Collaborator

osoykan commented Apr 12, 2023

Implemented with: #92

@osoykan osoykan closed this as completed Apr 12, 2023
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

No branches or pull requests

2 participants