Skip to content

Give the developer a small window of opportunity to know about retries #248

@gadenbuie

Description

@gadenbuie

When working with gargle via a package like googlesheets, failed requests are automatically retried. This is excellent and it means requests almost always make it through.

The downside is that the retries understandably backoff rather aggressively, so the wait time can be quite long, up to 100 seconds by default. In a Shiny app, this can be an eternity of waiting for the end user, and it'd be helpful for the app author to be able to give some feedback on the progress of the request.

The feature request is for gargle to offer some window of opportunity to know that a retry has happened and to run code before the next retry occurs.

Just brainstorming, two potential ways to do this could be:

  1. gargle::request_retry() could execute a callback function, found via an R option, before calling Sys.sleep().
  2. gargle::request_retry() could take inspiration from rlang::check_installed() and signal a known condition with restarts. This would give (admittedly expert) users a chance to run code before returning control to request_retry().

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions