withBackgroundReconnect returns a copy of ctx marked as a background reconnect attempt. It is set by tryRestart before calling connector.Connect so the connector can distinguish watcher reconnects from the initial interactive Start.
(ctx context.Context)
| 24 | // connector.Connect so the connector can distinguish watcher reconnects |
| 25 | // from the initial interactive Start. |
| 26 | func withBackgroundReconnect(ctx context.Context) context.Context { |
| 27 | return context.WithValue(ctx, backgroundReconnectKey{}, true) |
| 28 | } |
| 29 | |
| 30 | // IsBackgroundReconnect reports whether ctx was created by the supervisor |
| 31 | // for a background reconnect attempt. Connector.Connect implementations can |