29TEST(rpc, server_bind_sync_run_on_game_thread) {
30 const auto main_thread_id = std::this_thread::get_id();
36 server.BindSync(
"do_the_thing", [=](
int x,
int y) ->
int {
37 EXPECT_EQ(std::this_thread::get_id(), main_thread_id);
43 std::atomic_bool done{
false};
47 Client client(
"localhost", port);
48 for (
auto i = 0; i < 300; ++i) {
49 auto result = client.call(
"do_the_thing", i, 1).as<
int>();
50 EXPECT_EQ(result, i + 1);
56 for (; i < 1'000'000u; ++i) {
57 server.SyncRunFor(2ms);
62 std::cout <<
"game thread: run " << i <<
" slices.\n";