Description Usage Arguments Details Value Author(s) Examples
Top-level Request Driver for R
1 | doRequest(handler, request_msg)
|
handler |
An R method that handles the message type of
|
request_msg |
A list passed in from |
All client requests are eventually funneled through this
top-level request driver via the RequestServer
. It is
the job of the RequestServer
to inspect messages and
invoke doRequest
with the appropriate handler
.
In other words, doRequest
focuses purely on redirecting
stdout/stderr and calling the handler
. Message streams are
detoured to a socketConnection
hosted in the current thread
and connected to by a separate thread polling on a ZMQ_STREAM socket.
These details are all handled by the RequestServer
, and all
doRequest
does is sink
messages to the socket and perform
cleanup. The port is passed as part of the request_msg
, and is
chosen randomly by the RequestServer
.
A list having names msg_type
and content
. The
msg_type
is the reply type corresponding to the
request_msg
's message type. For example, a
kernel_info_request
message produces a list with
msg_type=kernel_info_reply
. The content
field
of this list is dictated by the Jupyter wire message protocol.
Note that the full reply to a Jupyter client is managed by the
RequestServer.
Spencer Aiello
1 2 3 4 5 6 | ## Not run:
handler <- execute_request
request_msg <- list(stream_out_port=54321, stream_err_port=54322, list(code="rnorm(1000)"))
doRequest(handler, request_msg)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.