Skip to content

Commit a4108f5

Browse files
committed
server: Adhere to naming conventions for shutdown_reasons
1 parent 4fd985a commit a4108f5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/server/server.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,15 +1164,15 @@ struct server_metrics {
11641164
}
11651165
};
11661166

1167-
struct Signal {
1167+
struct termination_signal {
11681168
int number;
11691169
};
11701170

1171-
struct StandbyTimeout {};
1171+
struct standby_timeout {};
11721172

1173-
using ShutdownReason = std::variant<Signal, StandbyTimeout>;
1173+
using shutdown_reason = std::variant<termination_signal, standby_timeout>;
11741174

1175-
std::function<void(ShutdownReason)> shutdown_handler;
1175+
std::function<void(shutdown_reason)> shutdown_handler;
11761176

11771177
struct server_queue {
11781178
int id = 0;
@@ -1310,7 +1310,7 @@ struct server_queue {
13101310
if (!condition_tasks.wait_for(lock, std::chrono::seconds(standby_timeout), pred)) {
13111311
lock.release()->unlock(); // unlock the unique_lock, before calling the shutdown_handler, as it tries to lock it
13121312
QUE_INF("%s", "stand-by timeout reached\n");
1313-
shutdown_handler(StandbyTimeout{});
1313+
shutdown_handler(::standby_timeout{});
13141314
break;
13151315
}
13161316
} else {
@@ -2916,7 +2916,7 @@ inline void signal_handler(int signal) {
29162916
exit(1);
29172917
}
29182918

2919-
shutdown_handler(Signal{ signal });
2919+
shutdown_handler(termination_signal{ signal });
29202920
}
29212921

29222922
int main(int argc, char ** argv) {
@@ -3956,7 +3956,7 @@ int main(int argc, char ** argv) {
39563956
ctx_server.queue_tasks.on_update_slots(std::bind(
39573957
&server_context::update_slots, &ctx_server));
39583958

3959-
shutdown_handler = [&](ShutdownReason) {
3959+
shutdown_handler = [&](shutdown_reason) {
39603960
ctx_server.queue_tasks.terminate();
39613961
};
39623962

0 commit comments

Comments
 (0)