-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from blendle/easy-errors
Add convenience function to handle stream errors
- Loading branch information
Showing
5 changed files
with
83 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package stream | ||
|
||
// ErrorCloser interface contains a shared subset of methods between consumers | ||
// and producers. This subset can be used to collectively listen to errors from | ||
// any of the configured stream consumers or producers, and close them all when | ||
// one triggers an error. | ||
type ErrorCloser interface { | ||
// Errors is a read-only channel on which the consumer or producer delivers | ||
// any errors that occurred while consuming from, or producing to the stream. | ||
Errors() <-chan error | ||
|
||
// Close closes the consumer or producer. After calling this method, the | ||
// consumer or producer is no longer in a usable state, and future method | ||
// calls can result in panics. | ||
// | ||
// Check the specific implementations to know what happens when calling close, | ||
// but in general any active connection to the message stream is terminated | ||
// and the messages channel is closed. | ||
Close() error | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters