Skip to content

Commit

Permalink
Updated receiver tutorial (#4511)
Browse files Browse the repository at this point in the history
Co-authored-by: Severin Neumann <[email protected]>
  • Loading branch information
zimny and svrnm authored May 22, 2024
1 parent 0ba998b commit dc636c5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions content/en/docs/collector/building/receiver.md
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,9 @@ func (tailtracerRcvr *tailtracerReceiver) Start(ctx context.Context, host compon
}

func (tailtracerRcvr *tailtracerReceiver) Shutdown(ctx context.Context) error {
tailtracerRcvr.cancel()
if tailtracerRcvr.cancel != nil {
tailtracerRcvr.cancel()
}
return nil
}
```
Expand All @@ -756,7 +758,7 @@ func (tailtracerRcvr *tailtracerReceiver) Shutdown(ctx context.Context) error {
function field with the cancellation based on a new context created with
`context.Background()` (according the Collector's API documentation
suggestions).
- Updated the `Stop()` method by adding a call to the `cancel()` context
- Updated the `Shutdown()` method by adding a call to the `cancel()` context
cancellation function.

{{% /alert %}}
Expand Down Expand Up @@ -829,7 +831,9 @@ func (tailtracerRcvr *tailtracerReceiver) Start(ctx context.Context, host compon
}

func (tailtracerRcvr *tailtracerReceiver) Shutdown(ctx context.Context) error {
tailtracerRcvr.cancel()
if tailtracerRcvr.cancel != nil {
tailtracerRcvr.cancel()
}
return nil
}
```
Expand Down

0 comments on commit dc636c5

Please sign in to comment.