-
Notifications
You must be signed in to change notification settings - Fork 65
/
retry.go
38 lines (32 loc) · 1.16 KB
/
retry.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package trace
// tool gtrace used from ./internal/cmd/gtrace
//go:generate gtrace
import (
"context"
)
type (
// Retry specified trace of retry call activity.
// gtrace:gen
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
Retry struct {
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
OnRetry func(RetryLoopStartInfo) func(RetryLoopDoneInfo)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
RetryLoopStartInfo struct {
// Context make available context in trace callback function.
// Pointer to context provide replacement of context in trace callback function.
// Warning: concurrent access to pointer on client side must be excluded.
// Safe replacement of context are provided only inside callback function
Context *context.Context
Call call
Label string
Idempotent bool
NestedCall bool // a sign for detect Retry calls inside head Retry
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
RetryLoopDoneInfo struct {
Attempts int
Error error
}
)