Skip to content

Commit

Permalink
Implementing run function
Browse files Browse the repository at this point in the history
  • Loading branch information
anutosh491 committed Mar 27, 2024
1 parent c372c0c commit b2e2234
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ set(XEUS_ZMQ_SOURCES
${XEUS_ZMQ_SOURCE_DIR}/xdealer_channel.cpp
${XEUS_ZMQ_SOURCE_DIR}/xiopub_client.hpp
${XEUS_ZMQ_SOURCE_DIR}/xiopub_client.cpp
${XEUS_ZMQ_SOURCE_DIR}/xheartbeat_client.hpp
${XEUS_ZMQ_SOURCE_DIR}/xheartbeat_client.cpp
)

# Targets and link
Expand Down
17 changes: 17 additions & 0 deletions src/xheartbeat_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,21 @@ namespace xeus
xheartbeat_client::~xheartbeat_client()
{
}

void xheartbeat_client::send_heartbeat_message()
{
zmq::message_t ping_msg("ping", 4);
m_heartbeat.send(ping_msg, zmq::send_flags::none);
}

void xheartbeat_client::run()
{
bool stop = false;
while(!stop)
{
send_heartbeat_message();
// TODO
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
}
}
4 changes: 3 additions & 1 deletion src/xheartbeat_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ namespace xeus
void run();

private:
zmq::socket_t m_iopub;
void send_heartbeat_message();

zmq::socket_t m_heartbeat;
zmq::socket_t m_controller;

xclient_zmq_impl* p_client_impl;
Expand Down

0 comments on commit b2e2234

Please sign in to comment.