App-EvalServer
view release on metacpan or search on metacpan
# ...
$server->shutdown();
DESCRIPTION
This application evaluates arbitrary source code in a safe enviroment.
It listens on a TCP port and accepts JSON data desribing a language and
some code to evaluate. The result of the evaluation and some
accompanying information is then returned as back as JSON data. See
"INPUT" and "OUTPUT" for details.
METHODS
"new"
Constructs a new "App::EvalServer" object. Takes the following optional
argunments:
'host', the host to listen on (default: 'localhost')
'port', the port to listen on (default: 14400)
'unsafe', don't chroot or set resource limits (no root needed). Default
is false.
"run"
Runs the server. Takes no arguments.
"shutdown"
Shuts down the server. Takes no arguments.
INPUT
To request an evaluation, you need to send a JSON hash containing the
following keys:
'lang', a string containing the language module suffix, e.g. 'Perl' for
App::EvalServer::Language::Perl.
'code', a string containing the code you want evaluated.
OUTPUT
When your request has been processed, you will receive a JSON hash back.
If no errors occurred before the code was evaluated, the hash will
contain the following keys:
* 'result', containing the result of the evaluation.
* 'stdout', a string containing everything that was printed to the
evaluating process' stdout handle.
* 'stderr', a string containing everything that was printed to the
lib/App/EvalServer.pm view on Meta::CPAN
# ...
$server->shutdown();
=head1 DESCRIPTION
This application evaluates arbitrary source code in a safe enviroment. It
listens on a TCP port and accepts JSON data desribing a language and some
code to evaluate. The result of the evaluation and some accompanying
information is then returned as back as JSON data. See L</INPUT> and
L</OUTPUT> for details.
=head1 METHODS
=head2 C<new>
Constructs a new C<App::EvalServer> object. Takes the following optional
argunments:
B<'host'>, the host to listen on (default: 'localhost')
lib/App/EvalServer.pm view on Meta::CPAN
false.
=head2 C<run>
Runs the server. Takes no arguments.
=head2 C<shutdown>
Shuts down the server. Takes no arguments.
=head1 INPUT
To request an evaluation, you need to send a JSON hash containing the
following keys:
B<'lang'>, a string containing the language module suffix, e.g. 'Perl' for
L<App::EvalServer::Language::Perl|App::EvalServer::Language::Perl>.
B<'code'>, a string containing the code you want evaluated.
=head1 OUTPUT
When your request has been processed, you will receive a JSON hash back. If
no errors occurred B<before> the code was evaluated, the hash will contain the
following keys:
=over 4
=item * B<'result'>, containing the result of the evaluation.
=item * B<'stdout'>, a string containing everything that was printed to the
( run in 0.590 second using v1.01-cache-2.11-cpan-4e96b696675 )