Add support for multiple environments
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reading dispatch.r and the API script handling /source_file, then trace how plumber requests currently use the global environment. Define the environment dispatch approach and verify that requests for different environments run in their own persisted environments rather than sharing the global one.
Written by the indexing model from the issue text.
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.
- Dominant language
- R
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dmarx/dispatchr
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Switch to POST? Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Add authentication Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Similar issues
-
rules
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
The-Strategy-Unit/nhp_reskit#229 ·
-
Affects Web App documentation PRIORITY LOW
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
hubverse-org/hubCI#36 ·