Search in sources :

Example 1 with ExecuteRequestHandler

use of com.twosigma.beakerx.kernel.handler.ExecuteRequestHandler in project beakerx by twosigma.

the class KernelHandlers method createHandlers.

private Map<JupyterMessages, KernelHandler<Message>> createHandlers(final CommOpenHandler commOpenHandler, final KernelHandler<Message> kernelInfoHandler) {
    Map<JupyterMessages, KernelHandler<Message>> handlers = new HashMap<>();
    if (kernelInfoHandler != null) {
        handlers.put(JupyterMessages.KERNEL_INFO_REQUEST, kernelInfoHandler);
    }
    if (commOpenHandler != null) {
        handlers.put(JupyterMessages.COMM_OPEN, commOpenHandler);
    }
    handlers.put(JupyterMessages.EXECUTE_REQUEST, new ExecuteRequestHandler(kernel));
    handlers.put(JupyterMessages.COMPLETE_REQUEST, new CompleteHandler(kernel));
    handlers.put(JupyterMessages.INSPECT_REQUEST, new InspectHandler(kernel));
    handlers.put(JupyterMessages.HISTORY_REQUEST, new HistoryHandler(kernel));
    handlers.put(JupyterMessages.COMM_INFO_REQUEST, new CommInfoHandler(kernel));
    handlers.put(JupyterMessages.COMM_CLOSE, new CommCloseHandler(kernel));
    handlers.put(JupyterMessages.COMM_MSG, new CommMsgHandler(kernel));
    handlers.put(JupyterMessages.IS_COMPLETE_REQUEST, new IsCompleteRequestHandler(kernel));
    return handlers;
}
Also used : CommInfoHandler(com.twosigma.beakerx.kernel.handler.CommInfoHandler) HashMap(java.util.HashMap) ExecuteRequestHandler(com.twosigma.beakerx.kernel.handler.ExecuteRequestHandler) InspectHandler(com.twosigma.beakerx.handler.InspectHandler) CommMsgHandler(com.twosigma.beakerx.kernel.handler.CommMsgHandler) HistoryHandler(com.twosigma.beakerx.handler.HistoryHandler) IsCompleteRequestHandler(com.twosigma.beakerx.handler.IsCompleteRequestHandler) CompleteHandler(com.twosigma.beakerx.handler.CompleteHandler) CommCloseHandler(com.twosigma.beakerx.kernel.handler.CommCloseHandler) JupyterMessages(com.twosigma.beakerx.kernel.msg.JupyterMessages) KernelHandler(com.twosigma.beakerx.handler.KernelHandler)

Example 2 with ExecuteRequestHandler

use of com.twosigma.beakerx.kernel.handler.ExecuteRequestHandler in project beakerx by twosigma.

the class ExecuteRequestHandlerMagicCommandTest method setUp.

@Before
public void setUp() {
    evaluator = new EvaluatorTest();
    kernel = new KernelTest("sid", evaluator);
    executeRequestHandler = new ExecuteRequestHandler(kernel);
}
Also used : KernelTest(com.twosigma.beakerx.KernelTest) ExecuteRequestHandler(com.twosigma.beakerx.kernel.handler.ExecuteRequestHandler) EvaluatorTest(com.twosigma.beakerx.evaluator.EvaluatorTest) Before(org.junit.Before)

Example 3 with ExecuteRequestHandler

use of com.twosigma.beakerx.kernel.handler.ExecuteRequestHandler in project beakerx by twosigma.

the class ExecuteRequestHandlerTest method setUp.

@Before
public void setUp() {
    executeRequestHandler = new ExecuteRequestHandler(kernel);
    message = JupyterHandlerTest.initExecuteRequestMessage();
    magicMessage = JupyterHandlerTest.initExecuteRequestMessage();
    magicMessage.getContent().put("code", "%lsmagic");
}
Also used : ExecuteRequestHandler(com.twosigma.beakerx.kernel.handler.ExecuteRequestHandler) Before(org.junit.Before)

Aggregations

ExecuteRequestHandler (com.twosigma.beakerx.kernel.handler.ExecuteRequestHandler)3 Before (org.junit.Before)2 KernelTest (com.twosigma.beakerx.KernelTest)1 EvaluatorTest (com.twosigma.beakerx.evaluator.EvaluatorTest)1 CompleteHandler (com.twosigma.beakerx.handler.CompleteHandler)1 HistoryHandler (com.twosigma.beakerx.handler.HistoryHandler)1 InspectHandler (com.twosigma.beakerx.handler.InspectHandler)1 IsCompleteRequestHandler (com.twosigma.beakerx.handler.IsCompleteRequestHandler)1 KernelHandler (com.twosigma.beakerx.handler.KernelHandler)1 CommCloseHandler (com.twosigma.beakerx.kernel.handler.CommCloseHandler)1 CommInfoHandler (com.twosigma.beakerx.kernel.handler.CommInfoHandler)1 CommMsgHandler (com.twosigma.beakerx.kernel.handler.CommMsgHandler)1 JupyterMessages (com.twosigma.beakerx.kernel.msg.JupyterMessages)1 HashMap (java.util.HashMap)1