mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 00:32:35 +01:00
ircd:Ⓜ️:feds: Rename interface function.
This commit is contained in:
parent
fca330e1c1
commit
3d808022ed
6 changed files with 18 additions and 18 deletions
|
@ -29,14 +29,14 @@ namespace ircd::m::feds
|
|||
enum class op :uint8_t;
|
||||
struct opts;
|
||||
struct result;
|
||||
struct acquire;
|
||||
struct execute;
|
||||
using closure = std::function<bool (const result &)>;
|
||||
};
|
||||
|
||||
struct ircd::m::feds::acquire
|
||||
struct ircd::m::feds::execute
|
||||
{
|
||||
acquire(const vector_view<const opts> &, const closure &);
|
||||
acquire(const opts &, const closure &);
|
||||
execute(const vector_view<const opts> &, const closure &);
|
||||
execute(const opts &, const closure &);
|
||||
};
|
||||
|
||||
struct ircd::m::feds::result
|
||||
|
|
|
@ -1027,16 +1027,16 @@ ircd::m::app::exists(const string_view &id)
|
|||
// m/feds.h
|
||||
//
|
||||
|
||||
ircd::m::feds::acquire::acquire(const opts &o,
|
||||
ircd::m::feds::execute::execute(const opts &o,
|
||||
const closure &c)
|
||||
:acquire
|
||||
:execute
|
||||
{
|
||||
vector_view<const opts>{&o, 1}, c
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
ircd::m::feds::acquire::acquire(const vector_view<const opts> &o,
|
||||
ircd::m::feds::execute::execute(const vector_view<const opts> &o,
|
||||
const closure &c)
|
||||
{
|
||||
using prototype = bool (const vector_view<const opts> &, const closure &);
|
||||
|
|
|
@ -11338,7 +11338,7 @@ console_cmd__feds__version(opt &out, const string_view &line)
|
|||
m::feds::opts opts;
|
||||
opts.op = m::feds::op::version;
|
||||
opts.room_id = room_id;
|
||||
m::feds::acquire(opts, [&out]
|
||||
m::feds::execute(opts, [&out]
|
||||
(const auto &result)
|
||||
{
|
||||
out << (result.eptr? '-' : '+')
|
||||
|
@ -11418,7 +11418,7 @@ console_cmd__feds__state(opt &out, const string_view &line)
|
|||
opts.room_id = room_id;
|
||||
opts.arg[0] = "ids";
|
||||
|
||||
m::feds::acquire(opts, closure);
|
||||
m::feds::execute(opts, closure);
|
||||
|
||||
for(auto &p : grid)
|
||||
{
|
||||
|
@ -11466,7 +11466,7 @@ console_cmd__feds__event(opt &out, const string_view &line)
|
|||
opts.op = m::feds::op::event;
|
||||
opts.room_id = room_id;
|
||||
opts.event_id = event_id;
|
||||
m::feds::acquire(opts, [&out](const auto &result)
|
||||
m::feds::execute(opts, [&out](const auto &result)
|
||||
{
|
||||
out << (result.eptr? '-': empty(result.object)? '?': '+')
|
||||
<< " "
|
||||
|
@ -11509,7 +11509,7 @@ console_cmd__feds__head(opt &out, const string_view &line)
|
|||
opts.room_id = room_id;
|
||||
opts.user_id = user_id;
|
||||
opts.timeout = out.timeout;
|
||||
m::feds::acquire(opts, [&out](const auto &result)
|
||||
m::feds::execute(opts, [&out](const auto &result)
|
||||
{
|
||||
if(result.eptr)
|
||||
{
|
||||
|
@ -11567,7 +11567,7 @@ console_cmd__feds__auth(opt &out, const string_view &line)
|
|||
opts.op = m::feds::op::auth;
|
||||
opts.room_id = room_id;
|
||||
opts.event_id = event_id;
|
||||
m::feds::acquire(opts, [&out](const auto &result)
|
||||
m::feds::execute(opts, [&out](const auto &result)
|
||||
{
|
||||
if(result.eptr)
|
||||
return true;
|
||||
|
@ -11707,7 +11707,7 @@ console_cmd__feds__perspective(opt &out, const string_view &line)
|
|||
opts.room_id = room_id;
|
||||
opts.arg[0] = server_key.first;
|
||||
opts.arg[1] = server_key.second;
|
||||
m::feds::acquire(opts, [&out](const auto &result)
|
||||
m::feds::execute(opts, [&out](const auto &result)
|
||||
{
|
||||
out << std::setw(32) << trunc(result.origin, 32) << " :";
|
||||
|
||||
|
@ -11767,7 +11767,7 @@ console_cmd__feds__backfill(opt &out, const string_view &line)
|
|||
opts.room_id = room_id;
|
||||
opts.event_id = event_id;
|
||||
opts.argi[0] = limit;
|
||||
m::feds::acquire(opts, [&grid, &origins]
|
||||
m::feds::execute(opts, [&grid, &origins]
|
||||
(const auto &result)
|
||||
{
|
||||
if(result.eptr)
|
||||
|
@ -11859,7 +11859,7 @@ console_cmd__feds__send(opt &out, const string_view &line)
|
|||
opts.room_id = at<"room_id"_>(event);
|
||||
opts.arg[0] = txnid;
|
||||
opts.arg[1] = content;
|
||||
m::feds::acquire(opts, [&out]
|
||||
m::feds::execute(opts, [&out]
|
||||
(const auto &result)
|
||||
{
|
||||
out << (result.eptr? '-' : '+')
|
||||
|
|
|
@ -500,7 +500,7 @@ command__ping__room(const mutable_buffer &buf,
|
|||
|
||||
util::timer timer;
|
||||
size_t responses{0};
|
||||
m::feds::acquire(opts, [&timer, &responses, &buf, &out]
|
||||
m::feds::execute(opts, [&timer, &responses, &buf, &out]
|
||||
(const auto &result)
|
||||
{
|
||||
++responses;
|
||||
|
|
|
@ -454,7 +454,7 @@ ircd::m::fetch::start(const m::room &room)
|
|||
opts.op = feds::op::head;
|
||||
opts.room_id = room.room_id;
|
||||
opts.closure_errors = false;
|
||||
feds::acquire
|
||||
feds::execute
|
||||
{
|
||||
opts, [](const auto &result)
|
||||
{
|
||||
|
|
|
@ -439,7 +439,7 @@ ircd::m::keys::get(const queries &queries,
|
|||
}
|
||||
|
||||
assert(opts.size() <= queries.size());
|
||||
m::feds::acquire(opts, [&ret, &closure]
|
||||
m::feds::execute(opts, [&ret, &closure]
|
||||
(const auto &result)
|
||||
{
|
||||
if(empty(result.object))
|
||||
|
|
Loading…
Reference in a new issue