Skip to content
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

Interpreter session per-user #6

Closed
mergeconflict opened this issue Jun 28, 2013 · 1 comment
Closed

Interpreter session per-user #6

mergeconflict opened this issue Jun 28, 2013 · 1 comment

Comments

@mergeconflict
Copy link
Contributor

There should be an REST resource corresponding to each interpreter session. Picturing the following:

  • /console
    • POST: Create a new sub-resource representing a session.

      Should respond with 201 CREATED, or 403 FORBIDDEN if somebody's spamming.

  • /console/{id}
    • POST: send code to be interpreted.

      Should respond with 200 OK normally, 400 BAD REQUEST if the code is broken, 403 FORBIDDEN if the user does something malicious like System.exit, or 404 NOT FOUND if the session id doesn't exist.

    • DELETE: kill the session.

      Should return 204 NO CONTENT normally, 404 NOT FOUND if the session id doesn't exist.

On the front-end, we'd store the current session URI in a browser cookie. If the cookie is present, the "submit" buttons would just POST to that URI. If absent, they would first need to POST to the /console root resource to obtain a session.

@mergeconflict
Copy link
Contributor Author

I just made Console an actor in #39, so theoretically the Scaffold actor could just spawn an arbitrary number of these in response to "POST /console" requests, and kill them after some timeout.

I say "theoretically" because who knows what sort of ridiculous global, mutable state the interpreter contains... It'll be super awesome if we have to spawn a JVM for each interpreter.

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

No branches or pull requests

1 participant