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

asio_service support stream mode #527

Merged
merged 6 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
pull_request:
branches:
- master
- streaming

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
Expand Down
8 changes: 8 additions & 0 deletions include/libnuraft/asio_service_options.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ struct asio_service_options {
, crc_on_entire_message_(false)
, crc_on_payload_(false)
, corrupted_msg_handler_(nullptr)
, streaming_mode_(false)
{}

/**
Expand Down Expand Up @@ -276,6 +277,13 @@ struct asio_service_options {
*/
std::function< void( std::shared_ptr<buffer>,
std::shared_ptr<buffer> ) > corrupted_msg_handler_;

/**
* If `true`, NuRaft will use streaming mode, which allows it to send
* subsequent requests without waiting for the response to previous requests.
* The order of responses will be identical to the order of requests.
*/
bool streaming_mode_;
};

}
Expand Down
1 change: 1 addition & 0 deletions scripts/test/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ set -e
./tests/raft_server_test --abort-on-failure
./tests/failure_test --abort-on-failure
./tests/asio_service_test --abort-on-failure
./tests/asio_service_stream_test --abort-on-failure
Loading
Loading