Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add support for multiple environments

Open
#2 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
r
Domain
api, backend

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dmarx/dispatchr

All issues in dmarx/dispatchr

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.