RunVoid applies retry / hedge / breaker / timeout to an inner function that returns only error. Used for Set / Delete operations.
( ctx context.Context, inner func(ctx context.Context) error, )
| 82 | // RunVoid applies retry / hedge / breaker / timeout to an inner function |
| 83 | // that returns only error. Used for Set / Delete operations. |
| 84 | func (e *cacheExecutor) RunVoid( |
| 85 | ctx context.Context, |
| 86 | inner func(ctx context.Context) error, |
| 87 | ) error { |
| 88 | wrap := func(ctx context.Context) ([]byte, error) { |
| 89 | return nil, inner(ctx) |
| 90 | } |
| 91 | _, err := e.RunBytes(ctx, wrap) |
| 92 | return err |
| 93 | } |
| 94 | |
| 95 | // execStateFromCtx returns the per-request ExecState attached to the |
| 96 | // context, or nil when the cache layer is being driven outside a |