dmarx / dmarx/dispatchr

Add support for multiple environments

Open
#2 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Right now, the api is passing everything into the global environment via GET requests to the endpoint `/source_file`. Would be cool if we could dispatch to different environments. Maybe something like:

Rscript dispatch.r env1 path/to/script1.r arg0 arg1
# localhost:8080/env1/source_file?fpath=path/to/script1.r&args=arg0&args=arg1

Rscript dispatch.r env2 path/to/script1.r arg0 arg1
# localhost:8080/env2/source_file?fpath=path/to/script1.r&args=arg0&args=arg1

I think this probably makes the most sense, but in reality the environment will probably have to be another query parameter rather than part of the endpoint.

Had to jump through quite a few hoops to figure out how to get stuff to run in the global environment: this might not be super easy. At least not with plumber... meh, who knows.

I'm pretty sure I tried something like this already, but I think the solution would be to, in the API script, grab the environment associated with the endpoint (or create it if it doesn't exist). There's probably a way to do this, although I recall having a lot of issues trying to do it this way.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.