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

EventBus interface question #6

Open
mammenj opened this issue Aug 29, 2017 · 6 comments
Open

EventBus interface question #6

mammenj opened this issue Aug 29, 2017 · 6 comments

Comments

@mammenj
Copy link

mammenj commented Aug 29, 2017

I see EventBus has publish but not a subscribe?
Just curious how the events propagated to projects for querying?
I apologize if subscribe is defined somewhere else as I did not read the source code completely.

@mishudark
Copy link
Owner

Hi, for now, the project ends on the publish of events, I think subscribe should be done very easy, for example, nats and rbmq has nice client libs, but definitely, to have a built-in interface for subscribing should be a nice feature

@mammenj
Copy link
Author

mammenj commented Aug 30, 2017

Would the Subscribe be something like below, your thoughts?

type EventBus interface {
	Subscribe(eventTopic string) (Event, error)
}

@mishudark
Copy link
Owner

I think it should be counterpart of publish interface

type Subscriber interface {
        Subscribe(bucket, subset string) (Event, error)
}

but I like the word topic probably instead of subset

@mammenj
Copy link
Author

mammenj commented Aug 30, 2017

Thanks for the response, makes sense to have it as as a separate interface.
Do you want me to pull and request for merge to include this interface and its implementation ?

@mammenj
Copy link
Author

mammenj commented Aug 30, 2017

How about something like this

type EventBus interface {
	Subscriber
	Publisher
}

type Subscriber interface {
        Subscribe(bucket, subset string) (Event, error)
}

type Publisher interface {
        Publish(event Event, bucket, subset string) error
}

@mishudark
Copy link
Owner

I like it, yes for sure, help is welcome :D

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