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

Server split #49

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 52 additions & 52 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ set(XEUS_ZMQ_HEADERS
${XEUS_ZMQ_INCLUDE_DIR}/xeus-zmq/xdebugger_base.hpp
${XEUS_ZMQ_INCLUDE_DIR}/xeus-zmq/xeus-zmq.hpp
${XEUS_ZMQ_INCLUDE_DIR}/xeus-zmq/xmiddleware.hpp
${XEUS_ZMQ_INCLUDE_DIR}/xeus-zmq/xserver_control_main.hpp
${XEUS_ZMQ_INCLUDE_DIR}/xeus-zmq/xserver_shell_main.hpp
${XEUS_ZMQ_INCLUDE_DIR}/xeus-zmq/xserver_zmq.hpp
${XEUS_ZMQ_INCLUDE_DIR}/xeus-zmq/xserver_zmq_split.hpp
${XEUS_ZMQ_INCLUDE_DIR}/xeus-zmq/xshell_default_runner.hpp
Expand All @@ -142,58 +144,56 @@ set(XEUS_ZMQ_HEADERS
)

set(XEUS_ZMQ_SOURCES
${XEUS_ZMQ_SOURCE_DIR}/xauthentication.cpp
${XEUS_ZMQ_SOURCE_DIR}/xauthentication.hpp
${XEUS_ZMQ_SOURCE_DIR}/xclient_zmq.cpp
${XEUS_ZMQ_SOURCE_DIR}/xclient_messenger.hpp
${XEUS_ZMQ_SOURCE_DIR}/xclient_messenger.cpp
${XEUS_ZMQ_SOURCE_DIR}/xclient_zmq_impl.hpp
${XEUS_ZMQ_SOURCE_DIR}/xclient_zmq_impl.cpp
${XEUS_ZMQ_SOURCE_DIR}/xcontrol_default_runner.cpp
${XEUS_ZMQ_SOURCE_DIR}/xcontrol_runner.cpp
${XEUS_ZMQ_SOURCE_DIR}/xcontrol.hpp
${XEUS_ZMQ_SOURCE_DIR}/xcontrol.cpp
${XEUS_ZMQ_SOURCE_DIR}/xdap_tcp_client.cpp
${XEUS_ZMQ_SOURCE_DIR}/xdap_tcp_client_impl.cpp
${XEUS_ZMQ_SOURCE_DIR}/xdap_tcp_client_impl.hpp
${XEUS_ZMQ_SOURCE_DIR}/xdealer_channel.hpp
${XEUS_ZMQ_SOURCE_DIR}/xdealer_channel.cpp
${XEUS_ZMQ_SOURCE_DIR}/xdebugger_base.cpp
${XEUS_ZMQ_SOURCE_DIR}/xdebugger_middleware.cpp
${XEUS_ZMQ_SOURCE_DIR}/xdebugger_middleware.hpp
${XEUS_ZMQ_SOURCE_DIR}/xheartbeat.cpp
${XEUS_ZMQ_SOURCE_DIR}/xheartbeat.hpp
${XEUS_ZMQ_SOURCE_DIR}/xheartbeat_client.hpp
${XEUS_ZMQ_SOURCE_DIR}/xheartbeat_client.cpp
${XEUS_ZMQ_SOURCE_DIR}/xiopub_client.hpp
${XEUS_ZMQ_SOURCE_DIR}/xiopub_client.cpp
${XEUS_ZMQ_SOURCE_DIR}/xmiddleware.cpp
${XEUS_ZMQ_SOURCE_DIR}/xmiddleware_impl.hpp
${XEUS_ZMQ_SOURCE_DIR}/xpublisher.cpp
${XEUS_ZMQ_SOURCE_DIR}/xpublisher.hpp
${XEUS_ZMQ_SOURCE_DIR}/xserver_control_main.cpp
${XEUS_ZMQ_SOURCE_DIR}/xserver_control_main.hpp
${XEUS_ZMQ_SOURCE_DIR}/xserver_shell_main.cpp
${XEUS_ZMQ_SOURCE_DIR}/xserver_shell_main.hpp
${XEUS_ZMQ_SOURCE_DIR}/xserver_zmq_default.cpp
${XEUS_ZMQ_SOURCE_DIR}/xserver_zmq_default.hpp
${XEUS_ZMQ_SOURCE_DIR}/xserver_zmq_impl.cpp
${XEUS_ZMQ_SOURCE_DIR}/xserver_zmq_impl.hpp
${XEUS_ZMQ_SOURCE_DIR}/xserver_zmq_split.cpp
${XEUS_ZMQ_SOURCE_DIR}/xserver_zmq_split_impl.cpp
${XEUS_ZMQ_SOURCE_DIR}/xserver_zmq_split_impl.hpp
${XEUS_ZMQ_SOURCE_DIR}/xserver_zmq.cpp
${XEUS_ZMQ_SOURCE_DIR}/xshell.hpp
${XEUS_ZMQ_SOURCE_DIR}/xshell.cpp
${XEUS_ZMQ_SOURCE_DIR}/xshell_default_runner.cpp
${XEUS_ZMQ_SOURCE_DIR}/xshell_runner.cpp
${XEUS_ZMQ_SOURCE_DIR}/xtrivial_messenger.hpp
${XEUS_ZMQ_SOURCE_DIR}/xtrivial_messenger.cpp
${XEUS_ZMQ_SOURCE_DIR}/xzmq_context.cpp
${XEUS_ZMQ_SOURCE_DIR}/xzmq_messenger.hpp
${XEUS_ZMQ_SOURCE_DIR}/xzmq_messenger.cpp
${XEUS_ZMQ_SOURCE_DIR}/xzmq_serializer.cpp
${XEUS_ZMQ_SOURCE_DIR}/xzmq_serializer.hpp
${XEUS_ZMQ_SOURCE_DIR}/client/xclient_zmq.cpp
${XEUS_ZMQ_SOURCE_DIR}/client/xclient_messenger.hpp
${XEUS_ZMQ_SOURCE_DIR}/client/xclient_messenger.cpp
${XEUS_ZMQ_SOURCE_DIR}/client/xclient_zmq_impl.hpp
${XEUS_ZMQ_SOURCE_DIR}/client/xclient_zmq_impl.cpp
${XEUS_ZMQ_SOURCE_DIR}/client/xdealer_channel.hpp
${XEUS_ZMQ_SOURCE_DIR}/client/xdealer_channel.cpp
${XEUS_ZMQ_SOURCE_DIR}/client/xheartbeat_client.hpp
${XEUS_ZMQ_SOURCE_DIR}/client/xheartbeat_client.cpp
${XEUS_ZMQ_SOURCE_DIR}/client/xiopub_client.hpp
${XEUS_ZMQ_SOURCE_DIR}/client/xiopub_client.cpp
${XEUS_ZMQ_SOURCE_DIR}/common/xauthentication.cpp
${XEUS_ZMQ_SOURCE_DIR}/common/xauthentication.hpp
${XEUS_ZMQ_SOURCE_DIR}/common/xmiddleware.cpp
${XEUS_ZMQ_SOURCE_DIR}/common/xmiddleware_impl.hpp
${XEUS_ZMQ_SOURCE_DIR}/common/xzmq_context.cpp
${XEUS_ZMQ_SOURCE_DIR}/common/xzmq_serializer.cpp
${XEUS_ZMQ_SOURCE_DIR}/common/xzmq_serializer.hpp
${XEUS_ZMQ_SOURCE_DIR}/debugger/xdap_tcp_client.cpp
${XEUS_ZMQ_SOURCE_DIR}/debugger/xdap_tcp_client_impl.cpp
${XEUS_ZMQ_SOURCE_DIR}/debugger/xdap_tcp_client_impl.hpp
${XEUS_ZMQ_SOURCE_DIR}/debugger/xdebugger_base.cpp
${XEUS_ZMQ_SOURCE_DIR}/debugger/xdebugger_middleware.cpp
${XEUS_ZMQ_SOURCE_DIR}/debugger/xdebugger_middleware.hpp
${XEUS_ZMQ_SOURCE_DIR}/server/xcontrol_default_runner.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xcontrol_runner.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xcontrol.hpp
${XEUS_ZMQ_SOURCE_DIR}/server/xcontrol.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xheartbeat.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xheartbeat.hpp
${XEUS_ZMQ_SOURCE_DIR}/server/xpublisher.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xpublisher.hpp
${XEUS_ZMQ_SOURCE_DIR}/server/xserver_control_main.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xserver_shell_main.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xserver_zmq_default.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xserver_zmq_default.hpp
${XEUS_ZMQ_SOURCE_DIR}/server/xserver_zmq_impl.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xserver_zmq_impl.hpp
${XEUS_ZMQ_SOURCE_DIR}/server/xserver_zmq_split.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xserver_zmq_split_impl.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xserver_zmq_split_impl.hpp
${XEUS_ZMQ_SOURCE_DIR}/server/xserver_zmq.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xshell.hpp
${XEUS_ZMQ_SOURCE_DIR}/server/xshell.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xshell_default_runner.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xshell_runner.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xtrivial_messenger.hpp
${XEUS_ZMQ_SOURCE_DIR}/server/xtrivial_messenger.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xzmq_messenger.hpp
${XEUS_ZMQ_SOURCE_DIR}/server/xzmq_messenger.cpp
)

# Targets and link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,24 @@

#include "xeus/xeus_context.hpp"
#include "xeus/xkernel_configuration.hpp"
#include "xeus-zmq/xserver_zmq_split.hpp"

#include "xeus-zmq.hpp"
#include "xserver_zmq_split.hpp"

namespace xeus
{
class xserver_control_main final : public xserver_zmq_split
class XEUS_ZMQ_API xserver_control_main final : public xserver_zmq_split
{
public:

using control_runner_ptr = xserver_zmq_split::control_runner_ptr;
using shell_runner_ptr = xserver_zmq_split::shell_runner_ptr;

xserver_control_main(xcontext& context,
const xconfiguration& config,
nl::json::error_handler_t eh);
nl::json::error_handler_t eh,
control_runner_ptr control,
shell_runner_ptr shell);

virtual ~xserver_control_main() = default;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,24 @@

#include "xeus/xeus_context.hpp"
#include "xeus/xkernel_configuration.hpp"
#include "xeus-zmq/xserver_zmq_split.hpp"

#include "xeus-zmq.hpp"
#include "xserver_zmq_split.hpp"

namespace xeus
{
class xserver_shell_main final : public xserver_zmq_split
class XEUS_ZMQ_API xserver_shell_main final : public xserver_zmq_split
{
public:

using control_runner_ptr = xserver_zmq_split::control_runner_ptr;
using shell_runner_ptr = xserver_zmq_split::shell_runner_ptr;

xserver_shell_main(xcontext& context,
const xconfiguration& config,
nl::json::error_handler_t eh);
nl::json::error_handler_t eh,
control_runner_ptr control,
shell_runner_ptr shell);

virtual ~xserver_shell_main() = default;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/xclient_zmq_impl.cpp → src/client/xclient_zmq_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

#include <iostream>

#include "xauthentication.hpp"
#include "xclient_zmq_impl.hpp"
#include "xzmq_serializer.hpp"
#include "../common/xauthentication.hpp"
#include "../common/xzmq_serializer.hpp"

namespace xeus
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "xheartbeat_client.hpp"
#include "xclient_zmq_impl.hpp"
#include "xmiddleware_impl.hpp"
#include "../common/xmiddleware_impl.hpp"

namespace xeus
{
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/xiopub_client.cpp → src/client/xiopub_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

#include "xiopub_client.hpp"
#include "xclient_zmq_impl.hpp"
#include "xmiddleware_impl.hpp"
#include "xzmq_serializer.hpp"
#include "../common/xmiddleware_impl.hpp"
#include "../common/xzmq_serializer.hpp"

namespace xeus
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "xeus/xmessage.hpp"
#include "xeus-zmq/xdap_tcp_client.hpp"
#include "xdap_tcp_client_impl.hpp"
#include "xzmq_serializer.hpp"
#include "../common/xzmq_serializer.hpp"

namespace xeus
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "nlohmann/json.hpp"
#include "xeus/xmessage.hpp"
#include "xdap_tcp_client_impl.hpp"
#include "xzmq_serializer.hpp"
#include "../common/xzmq_serializer.hpp"

namespace xeus
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "xeus/xeus_context.hpp"

#include "xeus-zmq/xdap_tcp_client.hpp"
#include "xauthentication.hpp"
#include "../common/xauthentication.hpp"

namespace nl = nlohmann;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/xcontrol.cpp → src/server/xcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <iostream>

#include "xcontrol.hpp"
#include "xmiddleware_impl.hpp"
#include "xserver_zmq_split_impl.hpp"
#include "../common/xmiddleware_impl.hpp"

namespace xeus
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/xheartbeat.cpp → src/server/xheartbeat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <string>

#include "zmq_addon.hpp"
#include "xmiddleware_impl.hpp"
#include "../common/xmiddleware_impl.hpp"
#include "xheartbeat.hpp"

namespace xeus
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/xpublisher.cpp → src/server/xpublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <string>

#include "xmiddleware_impl.hpp"
#include "../common/xmiddleware_impl.hpp"
#include "xpublisher.hpp"

namespace xeus
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@

#include "xeus-zmq/xcontrol_default_runner.hpp"
#include "xeus-zmq/xshell_default_runner.hpp"
#include "xserver_control_main.hpp"
#include "xeus-zmq/xserver_control_main.hpp"

namespace xeus
{
xserver_control_main::xserver_control_main(xcontext& context,
const xconfiguration& config,
nl::json::error_handler_t eh)
nl::json::error_handler_t eh,
control_runner_ptr control,
shell_runner_ptr shell)
: xserver_zmq_split(
context,
config,
eh,
std::make_unique<xcontrol_default_runner>(),
std::make_unique<xshell_default_runner>()
std::move(control),
std::move(shell)
)
{
}
Expand All @@ -41,7 +43,14 @@ namespace xeus
const xconfiguration& config,
nl::json::error_handler_t eh)
{
return std::make_unique<xserver_control_main>(context, config, eh);
return std::make_unique<xserver_control_main>
(
context,
config,
eh,
std::make_unique<xcontrol_default_runner>(),
std::make_unique<xshell_default_runner>()
);
}
}

19 changes: 14 additions & 5 deletions src/xserver_shell_main.cpp → src/server/xserver_shell_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@

#include "xeus-zmq/xcontrol_default_runner.hpp"
#include "xeus-zmq/xshell_default_runner.hpp"
#include "xserver_shell_main.hpp"
#include "xeus-zmq/xserver_shell_main.hpp"

namespace xeus
{
xserver_shell_main::xserver_shell_main(xcontext& context,
const xconfiguration& config,
nl::json::error_handler_t eh)
nl::json::error_handler_t eh,
control_runner_ptr control,
shell_runner_ptr shell)
: xserver_zmq_split(
context,
config,
eh,
std::make_unique<xcontrol_default_runner>(),
std::make_unique<xshell_default_runner>()
std::move(control),
std::move(shell)
)
{
}
Expand All @@ -40,7 +42,14 @@ namespace xeus
const xconfiguration& config,
nl::json::error_handler_t eh)
{
return std::make_unique<xserver_shell_main>(context, config, eh);
return std::make_unique<xserver_shell_main>
(
context,
config,
eh,
std::make_unique<xcontrol_default_runner>(),
std::make_unique<xshell_default_runner>()
);
}
}

File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/xserver_zmq_impl.cpp → src/server/xserver_zmq_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

#include <iostream>

#include "xmiddleware_impl.hpp"
#include "xserver_zmq_impl.hpp"
#include "xzmq_serializer.hpp"
#include "../common/xmiddleware_impl.hpp"
#include "../common/xzmq_serializer.hpp"

namespace xeus
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "xeus-zmq/xeus-zmq.hpp"
#include "xeus-zmq/xthread.hpp"

#include "xauthentication.hpp"
#include "../common/xauthentication.hpp"
#include "xpublisher.hpp"
#include "xheartbeat.hpp"
#include "xtrivial_messenger.hpp"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
****************************************************************************/

#include "xserver_zmq_split_impl.hpp"
#include "xzmq_serializer.hpp"
#include "../common/xzmq_serializer.hpp"

namespace xeus
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "xeus-zmq/xmiddleware.hpp"
#include "xeus-zmq/xthread.hpp"

#include "xauthentication.hpp"
#include "../common/xauthentication.hpp"
#include "xcontrol.hpp"
#include "xheartbeat.hpp"
#include "xpublisher.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/xshell.cpp → src/server/xshell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <iostream>

#include "xserver_zmq_split_impl.hpp"
#include "xmiddleware_impl.hpp"
#include "xshell.hpp"
#include "../common/xmiddleware_impl.hpp"

namespace xeus
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading