Use a generic type parameter for retry func in overload code example

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Unknown
    • 2.6.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Fully Compatible
    • Go Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      The executeWithRetries func in the examples for how to handle "SystemOverloadError" labels currently returns any, error. However, it's significantly more ergonomic to return T, error to preserve type information.

      E.g.

      func executeWithRetries[T any](
      	ctx context.Context, maxAttempts int,
      	fn func(ctx context.Context) (T, error),
      ) (T, error) {
      

      Definition of done

      • Update the "executeWithRetries" func to use a generic type param for the return type.

      Pitfalls

            Assignee:
            Qingyang Hu
            Reporter:
            Matt Dale
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: