Skip to content

Commit 8354196

Browse files
committed
more clear dsc examples
fix compile error
1 parent 260dfda commit 8354196

File tree

4 files changed

+8
-23
lines changed

4 files changed

+8
-23
lines changed

aos/exit_waiter/user_exit_on_signal/waiter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "boost/asio/io_context.hpp"
99
#include "boost/asio/signal_set.hpp"
1010
#include "boost/asio/this_coro.hpp"
11+
#include "boost/asio/thread_pool.hpp"
1112

1213
namespace aos {
1314
namespace impl {

aos/exit_waiter/user_exit_on_timeout/waiter.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
#pragma once
22
#include <atomic>
3-
#include <future>
43
#include <csignal>
4+
#include <future>
55

66
#include "aos/exit_waiter/i_exit_waiter.h"
7+
#include "aos/logger/mylog.h"
78
#include "boost/asio/io_context.hpp"
89
#include "boost/asio/signal_set.hpp"
10+
#include "boost/asio/steady_timer.hpp"
911
#include "boost/asio/this_coro.hpp"
10-
#include "aos/logger/my_logger.h"
12+
#include "boost/asio/thread_pool.hpp"
1113

1214
namespace aos {
1315
namespace impl {
1416
class UserExitOnTimeoutWaiter : public IExitWaiterInterface {
15-
public:
17+
public:
1618
UserExitOnTimeoutWaiter(boost::asio::thread_pool& pool,
1719
std::chrono::steady_clock::duration timeout)
1820
: timer_(pool.get_executor(), timeout) {}
@@ -33,7 +35,7 @@ class UserExitOnTimeoutWaiter : public IExitWaiterInterface {
3335
future.wait(); // блокируемся здесь
3436
}
3537

36-
private:
38+
private:
3739
boost::asio::steady_timer timer_;
3840
};
3941

examples/dsc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
33
| [example47](./example43/main.cpp) | subscribe to three Binance trading pairs that form a triangular arbitrage loop |
44
| [example46](./example43/main.cpp) | configure triangular arbitrage loop |
5-
| [example45](./example43/main.cpp) | Prototype to extract the current funding rate for a ticker on Binance |
5+
| [example45](./example43/main.cpp) | prototype to extract the current funding rate for a ticker on Binance |
66
| [example44](./example43/main.cpp) | improve deviation_and_mutual_information strategy |
77
| [example43](./example43/main.cpp) | bybit mainnet spot infrastructure |
88
| [example42](./example42/main.cpp) | bybit mainnet linear infrastructure |

examples/example47/main.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -129,24 +129,6 @@ class StrategyWrapper {
129129
};
130130
}; // namespace str
131131

132-
// class UserExitWaiter {
133-
// public:
134-
// explicit UserExitWaiter(boost::asio::thread_pool& pool)
135-
// : exit_future_(exit_promise_.get_future()) {
136-
// boost::asio::post(pool, [this] {
137-
// std::cout << "Press ENTER to exit...\n";
138-
// std::cin.get();
139-
// exit_promise_.set_value();
140-
// });
141-
// }
142-
143-
// void Wait() { exit_future_.wait(); }
144-
145-
// private:
146-
// std::promise<void> exit_promise_;
147-
// std::future<void> exit_future_;
148-
// };
149-
150132
int main(int, char**) {
151133
{
152134
try {

0 commit comments

Comments
 (0)