Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support select coro and channel #535

Merged
merged 9 commits into from
Mar 16, 2024
Merged

support select coro and channel #535

merged 9 commits into from
Mar 16, 2024

Conversation

qicosmos
Copy link
Owner

@qicosmos qicosmos commented Mar 6, 2024

channel

async_simple::coro::Lazy<void> test_channel() {
  auto ch = coro_io::create_channel<int>(1000);

  co_await coro_io::async_send(ch, 41);
  co_await coro_io::async_send(ch, 42);

  std::error_code ec;
  int val;
  std::tie(ec, val) = co_await coro_io::async_receive(ch);
  CHECK(val == 41);

  std::tie(ec, val) = co_await coro_io::async_receive(ch);
  CHECK(val == 42);
}

select channel and coroutine

async_simple::coro::Lazy<void> test_select_channel() {
  using namespace coro_io;
  using namespace async_simple;
  using namespace async_simple::coro;

  auto ch1 = coro_io::create_channel<int>(1000);
  auto ch2 = coro_io::create_channel<int>(1000);

  co_await async_send(ch1, 41);
  co_await async_send(ch2, 42);

  std::array<int, 2> arr{41, 42};
  int val;

  size_t index =
      co_await select(std::pair{async_receive(ch1),
                                [&val](auto value) {
                                  auto [ec, r] = value.value();
                                  val = r;
                                }},
                      std::pair{async_receive(ch2), [&val](auto value) {
                                  auto [ec, r] = value.value();
                                  val = r;
                                }});

  CHECK(val == arr[index]);

  co_await async_send(ch1, 41);
  co_await async_send(ch2, 42);

  std::vector<Lazy<std::pair<std::error_code, int>>> vec;
  vec.push_back(async_receive(ch1));
  vec.push_back(async_receive(ch2));

  index = co_await select(std::move(vec), [&](size_t i, auto result) {
    val = result.value().second;
  });
  CHECK(val == arr[index]);

  period_timer timer1(coro_io::get_global_executor());
  timer1.expires_after(100ms);
  period_timer timer2(coro_io::get_global_executor());
  timer2.expires_after(200ms);

  int val1;
  index = co_await select(std::pair{timer1.async_await(),
                                    [&](auto val) {
                                      CHECK(val.value());
                                      val1 = 0;
                                    }},
                          std::pair{timer2.async_await(), [&](auto val) {
                                      CHECK(val.value());
                                      val1 = 0;
                                    }});
  CHECK(index == val1);

  int val2;
  index = co_await select(std::pair{coro_io::post([] {
                                    }),
                                    [&](auto) {
                                      std::cout << "post1\n";
                                      val2 = 0;
                                    }},
                          std::pair{coro_io::post([] {
                                    }),
                                    [&](auto) {
                                      std::cout << "post2\n";
                                      val2 = 1;
                                    }});
  CHECK(index == val2);

  co_await async_send(ch1, 43);
  auto lazy = coro_io::post([] {
  });

  int val3 = -1;
  index = co_await select(std::pair{async_receive(ch1),
                                    [&](auto result) {
                                      val3 = result.value().second;
                                    }},
                          std::pair{std::move(lazy), [&](auto) {
                                      val3 = 0;
                                    }});

  if (index == 0) {
    CHECK(val3 == 43);
  }
  else if (index == 1) {
    CHECK(val3 == 0);
  }
}

Copy link

github-actions bot commented Mar 6, 2024

Code Coverage Report
for detail, goto summary download Artifacts

Filename                              Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cinatra_log_wrapper.hpp                       4                 1    75.00%           9                 1    88.89%           0                 0         -
cookie.hpp                                   15                 2    86.67%          84                 2    97.62%          28                 3    89.29%
coro_http_client.hpp                         86                 4    95.35%        1425               204    85.68%         456               116    74.56%
coro_http_connection.hpp                     36                 2    94.44%         660               161    75.61%         194                63    67.53%
coro_http_request.hpp                        27                 4    85.19%         189                15    92.06%          72                 9    87.50%
coro_http_response.hpp                       27                 6    77.78%         206                64    68.93%          88                37    57.95%
coro_http_router.hpp                         15                 0   100.00%         182                33    81.87%          20                 8    60.00%
coro_http_server.hpp                         40                 1    97.50%         776                66    91.49%         152                38    75.00%
coro_radix_tree.hpp                          17                 1    94.12%         264                45    82.95%         136                33    75.74%
define.h                                      2                 0   100.00%          28                 2    92.86%          20                 1    95.00%
http_parser.hpp                              28                 5    82.14%         196                32    83.67%          54                12    77.78%
mime_types.hpp                                1                 0   100.00%           7                 2    71.43%           2                 1    50.00%
multipart.hpp                                 4                 0   100.00%          86                13    84.88%          20                 4    80.00%
picohttpparser.h                             14                 6    57.14%         467               278    40.47%         210               102    51.43%
response_cv.hpp                               2                 0   100.00%          55                32    41.82%          46                16    65.22%
session.hpp                                  11                 0   100.00%          54                 2    96.30%           4                 1    75.00%
session_manager.hpp                          10                 1    90.00%          67                 5    92.54%          10                 1    90.00%
sha1.hpp                                     12                 0   100.00%         181                 8    95.58%          12                 2    83.33%
string_resize.hpp                             2                 0   100.00%          18                 0   100.00%           2                 0   100.00%
time_util.hpp                                18                 7    61.11%         154                70    54.55%          26                 2    92.31%
uri.hpp                                      17                 5    70.59%         200                57    71.50%         166                49    70.48%
url_encode_decode.hpp                         4                 0   100.00%          85                20    76.47%          48                16    66.67%
utils.hpp                                    14                 0   100.00%         202                22    89.11%         116                43    62.93%
websocket.hpp                                14                 3    78.57%         174                13    92.53%          78                18    76.92%
ylt/coro_io/channel.hpp                      15                 0   100.00%         106                 7    93.40%          30                 5    83.33%
ylt/coro_io/client_pool.hpp                  22                 4    81.82%         324               173    46.60%          72                46    36.11%
ylt/coro_io/coro_file.hpp                    17                 1    94.12%         162                31    80.86%          42                15    64.29%
ylt/coro_io/coro_io.hpp                      46                 2    95.65%         267                16    94.01%           4                 1    75.00%
ylt/coro_io/detail/client_queue.hpp          10                 5    50.00%          47                23    51.06%          10                 4    60.00%
ylt/coro_io/io_context_pool.hpp              30                 6    80.00%         186                36    80.65%          22                 7    68.18%
ylt/util/concurrentqueue.h                   78                27    65.38%        1241               722    41.82%         290               200    31.03%
ylt/util/expected.hpp                         6                 4    33.33%           6                 4    33.33%           0                 0         -
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                       644                97    84.94%        8108              2159    73.37%        2430               853    64.90%

Copy link

github-actions bot commented Mar 6, 2024

Code Coverage Report
for detail, goto summary download Artifacts

Filename                              Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cinatra_log_wrapper.hpp                       4                 1    75.00%           9                 1    88.89%           0                 0         -
cookie.hpp                                   15                 2    86.67%          84                 2    97.62%          28                 3    89.29%
coro_http_client.hpp                         86                 4    95.35%        1425               204    85.68%         456               115    74.78%
coro_http_connection.hpp                     36                 2    94.44%         660               161    75.61%         194                63    67.53%
coro_http_request.hpp                        27                 4    85.19%         189                15    92.06%          72                 9    87.50%
coro_http_response.hpp                       27                 6    77.78%         206                64    68.93%          88                37    57.95%
coro_http_router.hpp                         15                 0   100.00%         182                33    81.87%          20                 8    60.00%
coro_http_server.hpp                         40                 1    97.50%         776                66    91.49%         152                38    75.00%
coro_radix_tree.hpp                          17                 1    94.12%         264                45    82.95%         136                33    75.74%
define.h                                      2                 0   100.00%          28                 2    92.86%          20                 1    95.00%
http_parser.hpp                              28                 5    82.14%         196                32    83.67%          54                12    77.78%
mime_types.hpp                                1                 0   100.00%           7                 2    71.43%           2                 1    50.00%
multipart.hpp                                 4                 0   100.00%          86                13    84.88%          20                 4    80.00%
picohttpparser.h                             14                 6    57.14%         467               278    40.47%         210               102    51.43%
response_cv.hpp                               2                 0   100.00%          55                32    41.82%          46                16    65.22%
session.hpp                                  11                 0   100.00%          54                 2    96.30%           4                 1    75.00%
session_manager.hpp                          10                 1    90.00%          67                 5    92.54%          10                 1    90.00%
sha1.hpp                                     12                 0   100.00%         181                 8    95.58%          12                 2    83.33%
string_resize.hpp                             2                 0   100.00%          18                 0   100.00%           2                 0   100.00%
time_util.hpp                                18                 7    61.11%         154                70    54.55%          26                 2    92.31%
uri.hpp                                      17                 5    70.59%         200                57    71.50%         166                49    70.48%
url_encode_decode.hpp                         4                 0   100.00%          85                20    76.47%          48                16    66.67%
utils.hpp                                    14                 0   100.00%         202                22    89.11%         116                43    62.93%
websocket.hpp                                14                 3    78.57%         174                13    92.53%          78                18    76.92%
ylt/coro_io/channel.hpp                      15                 0   100.00%         106                 7    93.40%          30                 5    83.33%
ylt/coro_io/client_pool.hpp                  22                 4    81.82%         324               173    46.60%          72                46    36.11%
ylt/coro_io/coro_file.hpp                    17                 1    94.12%         162                31    80.86%          42                15    64.29%
ylt/coro_io/coro_io.hpp                      46                 2    95.65%         267                16    94.01%           4                 1    75.00%
ylt/coro_io/detail/client_queue.hpp          10                 5    50.00%          47                23    51.06%          10                 4    60.00%
ylt/coro_io/io_context_pool.hpp              30                 6    80.00%         186                36    80.65%          22                 7    68.18%
ylt/util/concurrentqueue.h                   78                27    65.38%        1241               722    41.82%         290               200    31.03%
ylt/util/expected.hpp                         6                 4    33.33%           6                 4    33.33%           0                 0         -
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                       644                97    84.94%        8108              2159    73.37%        2430               852    64.94%

Copy link

github-actions bot commented Mar 6, 2024

Code Coverage Report
for detail, goto summary download Artifacts

Filename                              Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cinatra_log_wrapper.hpp                       4                 1    75.00%           9                 1    88.89%           0                 0         -
cookie.hpp                                   15                 2    86.67%          84                 2    97.62%          28                 3    89.29%
coro_http_client.hpp                         86                 4    95.35%        1425               204    85.68%         456               116    74.56%
coro_http_connection.hpp                     36                 2    94.44%         660               161    75.61%         194                63    67.53%
coro_http_request.hpp                        27                 4    85.19%         189                15    92.06%          72                 9    87.50%
coro_http_response.hpp                       27                 6    77.78%         206                64    68.93%          88                37    57.95%
coro_http_router.hpp                         15                 0   100.00%         182                33    81.87%          20                 8    60.00%
coro_http_server.hpp                         40                 1    97.50%         776                66    91.49%         152                38    75.00%
coro_radix_tree.hpp                          17                 1    94.12%         264                45    82.95%         136                33    75.74%
define.h                                      2                 0   100.00%          28                 2    92.86%          20                 1    95.00%
http_parser.hpp                              28                 5    82.14%         196                32    83.67%          54                12    77.78%
mime_types.hpp                                1                 0   100.00%           7                 2    71.43%           2                 1    50.00%
multipart.hpp                                 4                 0   100.00%          86                13    84.88%          20                 4    80.00%
picohttpparser.h                             14                 6    57.14%         467               278    40.47%         210               102    51.43%
response_cv.hpp                               2                 0   100.00%          55                32    41.82%          46                16    65.22%
session.hpp                                  11                 0   100.00%          54                 2    96.30%           4                 1    75.00%
session_manager.hpp                          10                 1    90.00%          67                 5    92.54%          10                 1    90.00%
sha1.hpp                                     12                 0   100.00%         181                 8    95.58%          12                 2    83.33%
string_resize.hpp                             2                 0   100.00%          18                 0   100.00%           2                 0   100.00%
time_util.hpp                                18                 7    61.11%         154                70    54.55%          26                 2    92.31%
uri.hpp                                      17                 5    70.59%         200                57    71.50%         166                49    70.48%
url_encode_decode.hpp                         4                 0   100.00%          85                20    76.47%          48                16    66.67%
utils.hpp                                    14                 0   100.00%         202                22    89.11%         116                43    62.93%
websocket.hpp                                14                 3    78.57%         174                13    92.53%          78                18    76.92%
ylt/coro_io/channel.hpp                      15                 0   100.00%         106                 7    93.40%          30                 5    83.33%
ylt/coro_io/client_pool.hpp                  22                 4    81.82%         324               173    46.60%          72                46    36.11%
ylt/coro_io/coro_file.hpp                    17                 1    94.12%         162                31    80.86%          42                15    64.29%
ylt/coro_io/coro_io.hpp                      46                 2    95.65%         267                16    94.01%           4                 1    75.00%
ylt/coro_io/detail/client_queue.hpp          10                 5    50.00%          47                23    51.06%          10                 4    60.00%
ylt/coro_io/io_context_pool.hpp              30                 6    80.00%         186                36    80.65%          22                 7    68.18%
ylt/util/concurrentqueue.h                   78                27    65.38%        1241               722    41.82%         290               200    31.03%
ylt/util/expected.hpp                         6                 4    33.33%           6                 4    33.33%           0                 0         -
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                       644                97    84.94%        8108              2159    73.37%        2430               853    64.90%

@codecov-commenter
Copy link

codecov-commenter commented Mar 6, 2024

Codecov Report

Attention: Patch coverage is 86.74033% with 24 lines in your changes are missing coverage. Please review.

Project coverage is 69.50%. Comparing base (9206bb8) to head (0006d7b).
Report is 1 commits behind head on master.

Files Patch % Lines
tests/test_cinatra.cpp 76.47% 12 Missing ⚠️
include/async_simple/coro/Lazy.h 57.14% 6 Missing ⚠️
include/async_simple/coro/Collect.h 96.66% 2 Missing ⚠️
include/async_simple/coro/FutureAwaiter.h 77.77% 2 Missing ⚠️
include/async_simple/coro/ViaCoroutine.h 0.00% 1 Missing ⚠️
include/async_simple/util/move_only_function.h 97.22% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #535      +/-   ##
==========================================
- Coverage   69.89%   69.50%   -0.40%     
==========================================
  Files         235      236       +1     
  Lines       13848    13880      +32     
==========================================
- Hits         9679     9647      -32     
- Misses       4169     4233      +64     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Mar 6, 2024

Code Coverage Report
for detail, goto summary download Artifacts

Filename                              Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cinatra_log_wrapper.hpp                       4                 1    75.00%           9                 1    88.89%           0                 0         -
cookie.hpp                                   15                 2    86.67%          84                 2    97.62%          28                 3    89.29%
coro_http_client.hpp                         86                 4    95.35%        1425               200    85.96%         456               114    75.00%
coro_http_connection.hpp                     36                 2    94.44%         660               161    75.61%         194                63    67.53%
coro_http_request.hpp                        27                 4    85.19%         189                15    92.06%          72                 9    87.50%
coro_http_response.hpp                       27                 6    77.78%         206                64    68.93%          88                37    57.95%
coro_http_router.hpp                         15                 0   100.00%         182                33    81.87%          20                 8    60.00%
coro_http_server.hpp                         40                 1    97.50%         776                66    91.49%         152                38    75.00%
coro_radix_tree.hpp                          17                 1    94.12%         264                45    82.95%         136                33    75.74%
define.h                                      2                 0   100.00%          28                 2    92.86%          20                 1    95.00%
http_parser.hpp                              28                 5    82.14%         196                32    83.67%          54                12    77.78%
mime_types.hpp                                1                 0   100.00%           7                 2    71.43%           2                 1    50.00%
multipart.hpp                                 4                 0   100.00%          86                13    84.88%          20                 4    80.00%
picohttpparser.h                             14                 6    57.14%         467               278    40.47%         210               102    51.43%
response_cv.hpp                               2                 0   100.00%          55                32    41.82%          46                16    65.22%
session.hpp                                  11                 0   100.00%          54                 2    96.30%           4                 1    75.00%
session_manager.hpp                          10                 1    90.00%          67                 5    92.54%          10                 1    90.00%
sha1.hpp                                     12                 0   100.00%         181                 8    95.58%          12                 2    83.33%
string_resize.hpp                             2                 0   100.00%          18                 0   100.00%           2                 0   100.00%
time_util.hpp                                18                 7    61.11%         154                70    54.55%          26                 2    92.31%
uri.hpp                                      17                 5    70.59%         200                57    71.50%         166                49    70.48%
url_encode_decode.hpp                         4                 0   100.00%          85                20    76.47%          48                16    66.67%
utils.hpp                                    14                 0   100.00%         202                22    89.11%         116                43    62.93%
websocket.hpp                                14                 3    78.57%         174                13    92.53%          78                18    76.92%
ylt/coro_io/channel.hpp                      15                 0   100.00%         106                 7    93.40%          30                 5    83.33%
ylt/coro_io/client_pool.hpp                  22                 4    81.82%         324               173    46.60%          72                46    36.11%
ylt/coro_io/coro_file.hpp                    17                 1    94.12%         162                31    80.86%          42                15    64.29%
ylt/coro_io/coro_io.hpp                      46                 2    95.65%         267                16    94.01%           4                 1    75.00%
ylt/coro_io/detail/client_queue.hpp          10                 5    50.00%          47                23    51.06%          10                 4    60.00%
ylt/coro_io/io_context_pool.hpp              30                 6    80.00%         186                36    80.65%          22                 7    68.18%
ylt/util/concurrentqueue.h                   78                27    65.38%        1241               718    42.14%         290               198    31.72%
ylt/util/expected.hpp                         6                 4    33.33%           6                 4    33.33%           0                 0         -
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                       644                97    84.94%        8108              2151    73.47%        2430               849    65.06%

Copy link

github-actions bot commented Mar 6, 2024

Code Coverage Report
for detail, goto summary download Artifacts

Filename                              Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cinatra_log_wrapper.hpp                       4                 1    75.00%           9                 1    88.89%           0                 0         -
cookie.hpp                                   15                 2    86.67%          84                 2    97.62%          28                 3    89.29%
coro_http_client.hpp                         86                 4    95.35%        1425               200    85.96%         456               114    75.00%
coro_http_connection.hpp                     36                 2    94.44%         660               161    75.61%         194                62    68.04%
coro_http_request.hpp                        27                 4    85.19%         189                15    92.06%          72                 9    87.50%
coro_http_response.hpp                       27                 6    77.78%         206                64    68.93%          88                37    57.95%
coro_http_router.hpp                         15                 0   100.00%         182                33    81.87%          20                 8    60.00%
coro_http_server.hpp                         40                 1    97.50%         776                66    91.49%         152                38    75.00%
coro_radix_tree.hpp                          17                 1    94.12%         264                45    82.95%         136                33    75.74%
define.h                                      2                 0   100.00%          28                 2    92.86%          20                 1    95.00%
http_parser.hpp                              28                 5    82.14%         196                32    83.67%          54                12    77.78%
mime_types.hpp                                1                 0   100.00%           7                 2    71.43%           2                 1    50.00%
multipart.hpp                                 4                 0   100.00%          86                13    84.88%          20                 4    80.00%
picohttpparser.h                             14                 6    57.14%         467               278    40.47%         210               102    51.43%
response_cv.hpp                               2                 0   100.00%          55                32    41.82%          46                16    65.22%
session.hpp                                  11                 0   100.00%          54                 2    96.30%           4                 1    75.00%
session_manager.hpp                          10                 1    90.00%          67                 5    92.54%          10                 1    90.00%
sha1.hpp                                     12                 0   100.00%         181                 8    95.58%          12                 2    83.33%
string_resize.hpp                             2                 0   100.00%          18                 0   100.00%           2                 0   100.00%
time_util.hpp                                18                 7    61.11%         154                70    54.55%          26                 2    92.31%
uri.hpp                                      17                 5    70.59%         200                57    71.50%         166                49    70.48%
url_encode_decode.hpp                         4                 0   100.00%          85                20    76.47%          48                16    66.67%
utils.hpp                                    14                 0   100.00%         202                22    89.11%         116                43    62.93%
websocket.hpp                                14                 3    78.57%         174                13    92.53%          78                18    76.92%
ylt/coro_io/channel.hpp                      15                 0   100.00%         106                 7    93.40%          30                 5    83.33%
ylt/coro_io/client_pool.hpp                  22                 4    81.82%         324               173    46.60%          72                46    36.11%
ylt/coro_io/coro_file.hpp                    17                 1    94.12%         162                31    80.86%          42                15    64.29%
ylt/coro_io/coro_io.hpp                      46                 2    95.65%         267                16    94.01%           4                 1    75.00%
ylt/coro_io/detail/client_queue.hpp          10                 5    50.00%          47                23    51.06%          10                 4    60.00%
ylt/coro_io/io_context_pool.hpp              30                 6    80.00%         186                36    80.65%          22                 7    68.18%
ylt/util/concurrentqueue.h                   78                27    65.38%        1241               722    41.82%         290               200    31.03%
ylt/util/expected.hpp                         6                 4    33.33%           6                 4    33.33%           0                 0         -
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                       644                97    84.94%        8108              2155    73.42%        2430               850    65.02%

Copy link

github-actions bot commented Mar 7, 2024

Code Coverage Report
for detail, goto summary download Artifacts

Filename                              Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cinatra_log_wrapper.hpp                       4                 1    75.00%           9                 1    88.89%           0                 0         -
cookie.hpp                                   15                 2    86.67%          84                 2    97.62%          28                 3    89.29%
coro_http_client.hpp                         86                 4    95.35%        1425               204    85.68%         456               116    74.56%
coro_http_connection.hpp                     36                 2    94.44%         660               161    75.61%         194                63    67.53%
coro_http_request.hpp                        27                 4    85.19%         189                15    92.06%          72                 9    87.50%
coro_http_response.hpp                       27                 6    77.78%         206                64    68.93%          88                37    57.95%
coro_http_router.hpp                         15                 0   100.00%         182                33    81.87%          20                 8    60.00%
coro_http_server.hpp                         40                 1    97.50%         776                66    91.49%         152                38    75.00%
coro_radix_tree.hpp                          17                 1    94.12%         264                45    82.95%         136                33    75.74%
define.h                                      2                 0   100.00%          28                 2    92.86%          20                 1    95.00%
http_parser.hpp                              28                 5    82.14%         196                32    83.67%          54                12    77.78%
mime_types.hpp                                1                 0   100.00%           7                 2    71.43%           2                 1    50.00%
multipart.hpp                                 4                 0   100.00%          86                13    84.88%          20                 4    80.00%
picohttpparser.h                             14                 6    57.14%         467               278    40.47%         210               102    51.43%
response_cv.hpp                               2                 0   100.00%          55                32    41.82%          46                16    65.22%
session.hpp                                  11                 0   100.00%          54                 2    96.30%           4                 1    75.00%
session_manager.hpp                          10                 1    90.00%          67                 5    92.54%          10                 1    90.00%
sha1.hpp                                     12                 0   100.00%         181                 8    95.58%          12                 2    83.33%
string_resize.hpp                             2                 0   100.00%          18                 0   100.00%           2                 0   100.00%
time_util.hpp                                18                 7    61.11%         154                70    54.55%          26                 2    92.31%
uri.hpp                                      17                 5    70.59%         200                57    71.50%         166                49    70.48%
url_encode_decode.hpp                         4                 0   100.00%          85                20    76.47%          48                16    66.67%
utils.hpp                                    14                 0   100.00%         202                22    89.11%         116                43    62.93%
websocket.hpp                                14                 3    78.57%         174                13    92.53%          78                18    76.92%
ylt/coro_io/channel.hpp                      15                 0   100.00%         106                 7    93.40%          30                 5    83.33%
ylt/coro_io/client_pool.hpp                  22                 4    81.82%         324               173    46.60%          72                46    36.11%
ylt/coro_io/coro_file.hpp                    17                 1    94.12%         162                31    80.86%          42                15    64.29%
ylt/coro_io/coro_io.hpp                      46                 2    95.65%         267                16    94.01%           4                 1    75.00%
ylt/coro_io/detail/client_queue.hpp          10                 5    50.00%          47                23    51.06%          10                 4    60.00%
ylt/coro_io/io_context_pool.hpp              30                 6    80.00%         186                36    80.65%          22                 7    68.18%
ylt/util/concurrentqueue.h                   78                27    65.38%        1241               722    41.82%         290               200    31.03%
ylt/util/expected.hpp                         6                 4    33.33%           6                 4    33.33%           0                 0         -
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                       644                97    84.94%        8108              2159    73.37%        2430               853    64.90%

Copy link

Code Coverage Report
for detail, goto summary download Artifacts

Filename                              Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cinatra_log_wrapper.hpp                       4                 1    75.00%           9                 1    88.89%           0                 0         -
cookie.hpp                                   15                 2    86.67%          84                 2    97.62%          28                 3    89.29%
coro_http_client.hpp                         86                 4    95.35%        1425               204    85.68%         456               116    74.56%
coro_http_connection.hpp                     36                 2    94.44%         660               161    75.61%         194                63    67.53%
coro_http_request.hpp                        27                 4    85.19%         189                15    92.06%          72                 9    87.50%
coro_http_response.hpp                       27                 6    77.78%         206                64    68.93%          88                37    57.95%
coro_http_router.hpp                         15                 0   100.00%         182                33    81.87%          20                 8    60.00%
coro_http_server.hpp                         40                 1    97.50%         776                66    91.49%         152                38    75.00%
coro_radix_tree.hpp                          17                 1    94.12%         264                45    82.95%         136                33    75.74%
define.h                                      2                 0   100.00%          28                 2    92.86%          20                 1    95.00%
http_parser.hpp                              28                 5    82.14%         196                32    83.67%          54                12    77.78%
mime_types.hpp                                1                 0   100.00%           7                 2    71.43%           2                 1    50.00%
multipart.hpp                                 4                 0   100.00%          86                13    84.88%          20                 4    80.00%
picohttpparser.h                             14                 6    57.14%         467               278    40.47%         210               102    51.43%
response_cv.hpp                               2                 0   100.00%          55                32    41.82%          46                16    65.22%
session.hpp                                  11                 0   100.00%          54                 2    96.30%           4                 1    75.00%
session_manager.hpp                          10                 1    90.00%          67                 5    92.54%          10                 1    90.00%
sha1.hpp                                     12                 0   100.00%         181                 8    95.58%          12                 2    83.33%
string_resize.hpp                             2                 0   100.00%          18                 0   100.00%           2                 0   100.00%
time_util.hpp                                18                 7    61.11%         154                70    54.55%          26                 2    92.31%
uri.hpp                                      17                 5    70.59%         200                57    71.50%         166                49    70.48%
url_encode_decode.hpp                         4                 0   100.00%          85                20    76.47%          48                16    66.67%
utils.hpp                                    14                 0   100.00%         202                22    89.11%         116                43    62.93%
websocket.hpp                                14                 3    78.57%         174                13    92.53%          78                18    76.92%
ylt/coro_io/channel.hpp                      15                 0   100.00%         106                 7    93.40%          30                 5    83.33%
ylt/coro_io/client_pool.hpp                  22                 4    81.82%         324               173    46.60%          72                46    36.11%
ylt/coro_io/coro_file.hpp                    17                 1    94.12%         162                31    80.86%          42                15    64.29%
ylt/coro_io/coro_io.hpp                      46                 2    95.65%         267                16    94.01%           4                 1    75.00%
ylt/coro_io/detail/client_queue.hpp          10                 5    50.00%          47                23    51.06%          10                 4    60.00%
ylt/coro_io/io_context_pool.hpp              30                 6    80.00%         186                36    80.65%          22                 7    68.18%
ylt/util/concurrentqueue.h                   78                27    65.38%        1241               722    41.82%         290               200    31.03%
ylt/util/expected.hpp                         6                 4    33.33%           6                 4    33.33%           0                 0         -
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                       644                97    84.94%        8108              2159    73.37%        2430               853    64.90%

@qicosmos qicosmos merged commit e7c3527 into master Mar 16, 2024
22 checks passed
@qicosmos qicosmos deleted the select_coro branch March 16, 2024 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants