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

sdjournal: adds an async follower method #149

Closed
wants to merge 1 commit into from
Closed

Conversation

faiq
Copy link

@faiq faiq commented Apr 14, 2016

this allows consumers to asynchronously receive values from journald. It seems like we don't need the polling logic that the regular follow method had. Would love to hear thoughts and suggestions!

@faiq
Copy link
Author

faiq commented Apr 14, 2016

This is good if you want to stream values from journald to a logging solution such as loggly.

@@ -188,6 +188,29 @@ process:
return
}

func (r *JournalReader) FollowAsync(until <-chan time.Time, recieve chan<- []byte) <-chan error {
Copy link
Contributor

Choose a reason for hiding this comment

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

few things:

  • please add a docstring
  • s/recieve/receive
  • probably need to add a note that the until channel MUST be closed or this will leak a goroutine

@faiq faiq force-pushed the master branch 5 times, most recently from a216554 to a9129f5 Compare April 18, 2016 21:24
@faiq
Copy link
Author

faiq commented Apr 18, 2016

@jonboulle thanks for getting back to me so fast! ended up implementing all of your suggestions and it looking pretty good to me. Let me know if there are other things you'd like me to change as well!

this allows users to pull data from journal entries that aren't MESSAGE
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.

2 participants