Skip to content

Commit e2c5170

Browse files
committed
filebeat/input/v2: improve context cancelation documentation
1 parent ed2d884 commit e2c5170

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

filebeat/input/v2/input.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ type Context struct {
9999
Agent beat.Info
100100

101101
// Cancelation is used by Beats to signal the input to shut down.
102+
//
103+
// An input started with a Context parameter, ctx, must shut down when
104+
// <-ctx.Cancelation.Done() does not block or when ctx.Cancelation.Error()
105+
// returns a non-nil error. If an input is started with a specific Context
106+
// it should only shutdown in response to that Context's Cancelation.
102107
Cancelation Canceler
103108

104109
// StatusReporter provides a method to update the status of the underlying unit
@@ -221,6 +226,11 @@ type TestContext struct {
221226
Agent beat.Info
222227

223228
// Cancelation is used by Beats to signal the input to shut down.
229+
//
230+
// An input started with a Context parameter, ctx, must shut down when
231+
// <-ctx.Cancelation.Done() does not block or when ctx.Cancelation.Error()
232+
// returns a non-nil error. If an input is started with a specific Context
233+
// it should only shutdown in response to that Context's Cancelation.
224234
Cancelation Canceler
225235
}
226236

0 commit comments

Comments
 (0)