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

Allow Bus to buffer events in case listeners are not configured #8527

Merged
merged 1 commit into from
Oct 5, 2018

Conversation

vjsamuel
Copy link
Contributor

@vjsamuel vjsamuel commented Oct 1, 2018

This PR allows Beats to store events in a temporary channel in case there is not subscribed listener.

cc: @exekias please see if this is a valid usecase.

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

Copy link
Contributor

@exekias exekias left a comment

Choose a reason for hiding this comment

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

I'm not against this but I believe it should be optional, like accepting a parameter when creating the bus: NewBusWithStore(100). Current uses of the bugs should not be affected, even if there are no listeners

@@ -62,6 +63,7 @@ func New(name string) Bus {
return &bus{
name: name,
listeners: make([]*listener, 0),
store: make(chan Event, 100),
Copy link
Contributor

Choose a reason for hiding this comment

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

this number sounds too arbitrary? I would put it as a parameter

@@ -65,11 +66,40 @@ func New(name string) Bus {
}
}

func NewBusWithStore(name string, size int) Bus {

Choose a reason for hiding this comment

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

exported function NewBusWithStore should have comment or be unexported

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lol. does hound not recognize multiline comments? @exekias

Copy link
Contributor

Choose a reason for hiding this comment

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

weird, I think it does, let's ignore it this time :)

@vjsamuel vjsamuel force-pushed the bus_hold branch 2 times, most recently from 842b3ad to 297f6a2 Compare October 3, 2018 17:33
Copy link
Contributor

@exekias exekias left a comment

Choose a reason for hiding this comment

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

LGTM, can you please fix the format issues? https://travis-ci.org/elastic/beats/jobs/436753359

@exekias
Copy link
Contributor

exekias commented Oct 4, 2018

jenkins test this please

Copy link
Contributor

@exekias exekias left a comment

Choose a reason for hiding this comment

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

WFG

@exekias exekias merged commit c67b88a into elastic:master Oct 5, 2018
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.

4 participants