Slick Sim 0.10.1
Exchange simulator that shadows real venues for risk-free strategy testing
Loading...
Searching...
No Matches
rest_ws_order_gateway.cpp
Go to the documentation of this file.
1#include <slick/logger.hpp>
3
5
7 thread_ = std::thread([this]() {
8 auto app = uWS::App();
9 setup_routes(app);
10 app.listen(port_, [this](auto* listen_socket) {
11 listen_socket_ = listen_socket;
12 if (listen_socket) {
13 loop_ = uWS::Loop::get();
14 on_listen_socket(listen_socket);
15 LOG_INFO("{} {} OrderGateway started on port {}", to_string(venue_), type(), port_);
16 } else {
17 LOG_ERROR("{} {} OrderGateway failed to listen on port {}", to_string(venue_), type(), port_);
18 }
19 }).run();
20 });
21}
22
23}
virtual std::string_view type() const noexcept=0
virtual void setup_routes(uWS::App &app)=0
virtual void on_listen_socket(us_listen_socket_t *listen_socket)
constexpr const char * to_string(FeedState state) noexcept