Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Add query bus supporting more than one handler #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GMadorell
Copy link

Fixes #2

@rgomezcasas rgomezcasas self-requested a review November 6, 2017 21:50
@rgomezcasas
Copy link
Member

I'll review this on the weekend! :)

Copy link
Member

@JavierCane JavierCane left a comment

Choose a reason for hiding this comment

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

Very good work @GMadorell!

I've just added a suggestion regarding the mutability of the QueryBus. Please, tell me what do you think about it 🙂

Thanks!!

@@ -4,4 +4,6 @@ import java.util.UUID

import org.joda.time.DateTime

abstract class Query(val queryId: UUID, val askedAt: DateTime) extends Request(queryId, askedAt)
abstract class Query(val queryId: UUID, val askedAt: DateTime) extends Request(queryId, askedAt) {
type QueryResponse <: Response
Copy link
Member

Choose a reason for hiding this comment

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

I didn't have used the types as you've done in this PR yet. Thanks for sharing!

)
)
val queryBus = new QueryBus[EitherThrowable]()
queryBus.subscribe(generateUserGreetQueryHandler)
Copy link
Member

Choose a reason for hiding this comment

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

Could you try to refactor this requiring to inject the subscribers while creating the QueryBus instance as we where doing?

This way we would be avoiding mutable state inside the QueryBus 🙂

If you don't have time in order to add this improvement, we could merge this PR and do that later 🙂

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

Successfully merging this pull request may close these issues.

3 participants