18 #ifndef DATA_FEED_EXTENSIONS_HEARTBEAT_HPP
19 #define DATA_FEED_EXTENSIONS_HEARTBEAT_HPP
21 #include "data_feed/receiver.hpp"
31 namespace Extensions {
40 asio::steady_timer timer;
49 stream <<
"\033[2J" <<
"\033[1;1H" << std::endl;
51 stream << receiver.
get_book() << std::endl;
53 timer.expires_after(std::chrono::milliseconds(time));
54 timer.async_wait([
this](
const std::error_code& error) {
55 if (error)
throw error;
69 asio::io_context& context,
72 std::ostream& stream_ = std::cout
73 ) : receiver(receiver_), timer(context), time(time_), stream(stream_) {
82 #endif // DATA_FEED_EXTENSIONS_HEARTBEAT_HPP