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

Coroutinize http client code #2429

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
797dc34
http/client: Coroutinize connection::write_body
xemul Sep 12, 2024
32365d4
http/client: Coroutinize connection::maybe_wait_for_continue
xemul Sep 12, 2024
e8df44b
http/client: Coroutinize connection::send_request_head
xemul Sep 12, 2024
dd51c2c
http/client: Coroutinize connection::recv_reply
xemul Sep 12, 2024
ad9833d
http/client: Restore indentation of connection::recv_reply
xemul Sep 12, 2024
9b46ea5
http/client: Coroutinize connection::do_make_request
xemul Sep 12, 2024
86d6a8b
http/client: Restore indentation of connection::do_make_request
xemul Sep 12, 2024
14e3efc
http/client: Squash maybe_wait_for_continue into do_make_request
xemul Sep 12, 2024
c5a63be
http/client Squash send_request_head into do_make_request
xemul Sep 12, 2024
9b473bf
http/client: Coroutinize connection::make_request
xemul Sep 12, 2024
ffacf24
http/client: Coroutinize connection::close
xemul Sep 12, 2024
cb1b4b6
http/client: Restore indentation of connection::close
xemul Sep 12, 2024
bd36cf3
http/client: Coroutinize client::make_connection
xemul Sep 12, 2024
bdfdf16
http/client: Restore indentation of client::make_connection
xemul Sep 12, 2024
2d1550e
http/client: Coroutinize client::put_connection
xemul Sep 12, 2024
215e024
http/client: Coroutinize client::shrink_connections
xemul Sep 12, 2024
88de135
http/client: Restore indentation of client::shrink_connections
xemul Sep 12, 2024
b10c8b6
http/client: Coroutinize client::set_maximum_connections
xemul Sep 12, 2024
685f6f2
http/client: Coroutinize client::with_connection
xemul Sep 12, 2024
200ea10
http/client: Coroutinize client::with_new_connection
xemul Sep 12, 2024
4250bca
http/client: Coroutinize client::close
xemul Sep 12, 2024
688ac04
http/client: Restore indentation of client::close
xemul Sep 12, 2024
3e22a25
http/client: Coroutinize client::do_make_request
xemul Sep 12, 2024
02df7b8
http/client: Sanitize client::do_make_request unexpected body logging
xemul Sep 12, 2024
4dfb090
http/client: Coroutinize client::get_connection
xemul Sep 12, 2024
539fa2a
http/client: Restore indentation of client::get_connection
xemul Sep 12, 2024
3231966
http/client: Coroutinize client::do_make_request (con-less overload)
xemul Sep 12, 2024
67134fd
http/client: Restore indentation of client::do_make_request overload
xemul Sep 12, 2024
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
6 changes: 2 additions & 4 deletions include/seastar/http/client.hh
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ public:
private:
future<reply_ptr> do_make_request(request& rq);
void setup_request(request& rq);
future<> send_request_head(const request& rq);
future<reply_ptr> maybe_wait_for_continue(const request& req);
future<> write_body(const request& rq);
future<reply_ptr> recv_reply();

Expand Down Expand Up @@ -193,11 +191,11 @@ private:
future<> shrink_connections();

template <std::invocable<connection&> Fn>
auto with_connection(Fn&& fn, abort_source*);
futurize_t<std::invoke_result_t<Fn, connection&>> with_connection(Fn fn, abort_source*);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh, i believe Avi would like this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has less than 4 closing corner braces in a row, so not that bad

Meanwhile in scylla (scroll right):

test/boost/user_function_test.cc:769:        e.execute_cql("CREATE FUNCTION my_func(val int) CALLED ON NULL INPUT RETURNS map<int, frozen<set<frozen<list<frozen<tuple<text, bigint>>>>>>> LANGUAGE Lua AS  \

😱

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, i meant, he always prefers an explicit return type. this one make it more explicit. so..


template <typename Fn>
requires std::invocable<Fn, connection&>
auto with_new_connection(Fn&& fn, abort_source*);
futurize_t<std::invoke_result_t<Fn, connection&>> with_new_connection(Fn fn, abort_source*);

future<> do_make_request(request req, reply_handler handle, abort_source*, std::optional<reply::status_type> expected);
future<> do_make_request(connection& con, request& req, reply_handler& handle, abort_source*, std::optional<reply::status_type> expected);
Expand Down
Loading