diff --git a/include/xeus/xainterpreter.hpp b/include/xeus/xainterpreter.hpp index f74147af..7f4a967d 100644 --- a/include/xeus/xainterpreter.hpp +++ b/include/xeus/xainterpreter.hpp @@ -66,6 +66,8 @@ namespace xeus void display_data(nl::json data, nl::json metadata, nl::json transient); void update_display_data(nl::json data, nl::json metadata, nl::json transient); void publish_execution_input(const std::string& code, int execution_count); + //void publish_execution_input(const std::string& code, int execution_count, nl::json parent_header); + void publish_execution_result(int execution_count, nl::json data, nl::json metadata); void publish_execution_error(const std::string& ename, const std::string& evalue, diff --git a/include/xeus/xaresponse_sender.hpp b/include/xeus/xaresponse_sender.hpp index a6049ce5..77a59233 100644 --- a/include/xeus/xaresponse_sender.hpp +++ b/include/xeus/xaresponse_sender.hpp @@ -37,12 +37,18 @@ namespace xeus } std::cout<<" in xaresponse_sender sending reply "< m_post_send = nullptr; + // void(nl::json, nl::json, nl::json) == void(parent, reply, metadata) + std::function m_post_send = nullptr; }; } // namespace xeus diff --git a/src/xainterpreter.cpp b/src/xainterpreter.cpp index 756c30bd..5d2ca227 100644 --- a/src/xainterpreter.cpp +++ b/src/xainterpreter.cpp @@ -38,24 +38,24 @@ namespace xeus bool allow_stdin, xaresponse_sender response_sender) { - auto execution_count = m_execution_count; + if (!silent) { ++m_execution_count; - publish_execution_input(code, m_execution_count); } + auto execution_count = m_execution_count; auto post_send = std::move(response_sender.m_post_send); - response_sender.m_post_send = [this,post_send, execution_count](nl::json reply, nl::json meta) { + response_sender.m_post_send = [this,post_send, execution_count](nl::json parent, nl::json reply, nl::json meta) { std::cout<<" in xainterpreter sending reply "<publish(std::move(msg), c); } + + void xkernel_core::publish_message(const std::string& msg_type, + nl::json metadata, + nl::json content, + buffer_sequence buffers, + channel c) + { + publish_message(msg_type, get_parent_header(c), std::move(metadata), std::move(content), std::move(buffers), c); + } + void xkernel_core::send_stdin(const std::string& msg_type, nl::json metadata, nl::json content) @@ -243,11 +254,8 @@ namespace xeus const auto parent_header = get_parent_header(c); p_interpreter->async_execute_request( - - - code, silent, store_history, std::move(user_expression), allow_stdin, - xaresponse_sender{std::move(metadata), [=](auto reply, auto meta) + xaresponse_sender{std::move(parent_header), std::move(metadata), [=](auto parent, auto reply, auto meta) { std::cout<<"in xkernelcore sender"<