Skip to content

interface with the user's R session #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed

interface with the user's R session #6

wants to merge 8 commits into from

Conversation

simonpcouch
Copy link
Collaborator

Closes #5.

Comment on lines +5 to +8
existing_server <- httpuv::listServers()
if (length(existing_server) > 0) {
httpuv::stopServer(existing_server[[1]])
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that if the user started a Shiny or Plumber app, this code would stop that app.

I suggest doing something like this: create an environment called globals at the top level of the package with a member called mcpserver that starts out NULL, and then when you create the server, store it there:

  globals$mcpserver <- httpuv::startServer(...)

Then just check for that

@simonpcouch
Copy link
Collaborator Author

Closing in favor of #7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ping the actual session
2 participants