Skip to content

Using Memoise with RESTful API Calls that Require Unique Access Token #116

Open
@masato-yoshihara

Description

@masato-yoshihara

I'm looking to use memoise in my R Shiny application with functions that will query our database on MongoDB Atlas using a RESTful API that requires a unique access token per session. For example:

#Calls to the RESTful API are made within the function.
getResults <- function(query, access_token){
     #Code here!
}
getResultsMem <- memoise(getResults)

From what I understand, because memoise caches the function rather than the results, I'm having an issue where I can't use memoise since the access token changes every time that the user logs in. Since the database will only be updated once a year, memoise/caching is an ideal solution for my application. Is there a solution around this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions