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:
parent
3910b3af91
commit
a6d47ccfcd
4 changed files with 15 additions and 17 deletions
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue