0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 02:02:38 +01:00

ircd:Ⓜ️ Simplify various future timed wait()/get() related.

This commit is contained in:
Jason Volk 2020-11-02 11:41:56 -08:00
parent 3910b3af91
commit a6d47ccfcd
4 changed files with 15 additions and 17 deletions

View file

@ -225,8 +225,11 @@ try
queries, buf, std::move(opts)
};
request.wait(milliseconds(keys_query_timeout));
const auto &code(request.get());
const auto &code
{
request.get(milliseconds(keys_query_timeout))
};
const json::array response
{
request
@ -343,10 +346,9 @@ try
{query}, buf, std::move(opts)
};
request.wait(milliseconds(keys_get_timeout));
const auto &status
const auto status
{
request.get()
request.get(milliseconds(keys_get_timeout))
};
// note fed::key::query gives us "server_keys" array via cast operator.

View file

@ -360,10 +360,9 @@ try
alias, buf, std::move(opts)
};
request.wait(seconds(alias_fetch_timeout));
const http::code &code
{
request.get()
request.get(seconds(alias_fetch_timeout))
};
const json::object response

View file

@ -453,11 +453,9 @@ try
room_id, buf, std::move(opts)
};
request.wait(seconds(backfill_timeout));
const auto code
{
request.get()
request.get(seconds(backfill_timeout))
};
const json::object &response
@ -578,11 +576,9 @@ try
room_id, event_id, event, buf, std::move(opts)
};
send_join.wait(seconds(send_join_timeout));
const auto send_join_code
{
send_join.get()
send_join.get(seconds(send_join_timeout))
};
const json::array send_join_response
@ -642,10 +638,9 @@ try
room_id, user_id, buf, std::move(opts)
};
request.wait(seconds(make_join_timeout));
const auto code
{
request.get()
request.get(seconds(make_join_timeout))
};
const json::object &response

View file

@ -60,8 +60,10 @@ ircd::m::room::head::fetch(const id &room_id,
room_id, user_id, buf, std::move(opts)
};
request.wait(milliseconds(fetch_timeout));
request.get();
const auto code
{
request.get(milliseconds(fetch_timeout))
};
const json::object proto
{