0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-12 13:01:07 +01:00

ircd:Ⓜ️:feds: Rename interface function.

This commit is contained in:
Jason Volk 2019-08-14 01:26:02 -07:00
parent fca330e1c1
commit 3d808022ed
6 changed files with 18 additions and 18 deletions

View file

@ -29,14 +29,14 @@ namespace ircd::m::feds
enum class op :uint8_t; enum class op :uint8_t;
struct opts; struct opts;
struct result; struct result;
struct acquire; struct execute;
using closure = std::function<bool (const result &)>; 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 &); execute(const vector_view<const opts> &, const closure &);
acquire(const opts &, const closure &); execute(const opts &, const closure &);
}; };
struct ircd::m::feds::result struct ircd::m::feds::result

View file

@ -1027,16 +1027,16 @@ ircd::m::app::exists(const string_view &id)
// m/feds.h // m/feds.h
// //
ircd::m::feds::acquire::acquire(const opts &o, ircd::m::feds::execute::execute(const opts &o,
const closure &c) const closure &c)
:acquire :execute
{ {
vector_view<const opts>{&o, 1}, c 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) const closure &c)
{ {
using prototype = bool (const vector_view<const opts> &, const closure &); using prototype = bool (const vector_view<const opts> &, const closure &);

View file

@ -11338,7 +11338,7 @@ console_cmd__feds__version(opt &out, const string_view &line)
m::feds::opts opts; m::feds::opts opts;
opts.op = m::feds::op::version; opts.op = m::feds::op::version;
opts.room_id = room_id; opts.room_id = room_id;
m::feds::acquire(opts, [&out] m::feds::execute(opts, [&out]
(const auto &result) (const auto &result)
{ {
out << (result.eptr? '-' : '+') out << (result.eptr? '-' : '+')
@ -11418,7 +11418,7 @@ console_cmd__feds__state(opt &out, const string_view &line)
opts.room_id = room_id; opts.room_id = room_id;
opts.arg[0] = "ids"; opts.arg[0] = "ids";
m::feds::acquire(opts, closure); m::feds::execute(opts, closure);
for(auto &p : grid) 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.op = m::feds::op::event;
opts.room_id = room_id; opts.room_id = room_id;
opts.event_id = event_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)? '?': '+') 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.room_id = room_id;
opts.user_id = user_id; opts.user_id = user_id;
opts.timeout = out.timeout; opts.timeout = out.timeout;
m::feds::acquire(opts, [&out](const auto &result) m::feds::execute(opts, [&out](const auto &result)
{ {
if(result.eptr) if(result.eptr)
{ {
@ -11567,7 +11567,7 @@ console_cmd__feds__auth(opt &out, const string_view &line)
opts.op = m::feds::op::auth; opts.op = m::feds::op::auth;
opts.room_id = room_id; opts.room_id = room_id;
opts.event_id = event_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) if(result.eptr)
return true; return true;
@ -11707,7 +11707,7 @@ console_cmd__feds__perspective(opt &out, const string_view &line)
opts.room_id = room_id; opts.room_id = room_id;
opts.arg[0] = server_key.first; opts.arg[0] = server_key.first;
opts.arg[1] = server_key.second; 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) << " :"; 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.room_id = room_id;
opts.event_id = event_id; opts.event_id = event_id;
opts.argi[0] = limit; opts.argi[0] = limit;
m::feds::acquire(opts, [&grid, &origins] m::feds::execute(opts, [&grid, &origins]
(const auto &result) (const auto &result)
{ {
if(result.eptr) 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.room_id = at<"room_id"_>(event);
opts.arg[0] = txnid; opts.arg[0] = txnid;
opts.arg[1] = content; opts.arg[1] = content;
m::feds::acquire(opts, [&out] m::feds::execute(opts, [&out]
(const auto &result) (const auto &result)
{ {
out << (result.eptr? '-' : '+') out << (result.eptr? '-' : '+')

View file

@ -500,7 +500,7 @@ command__ping__room(const mutable_buffer &buf,
util::timer timer; util::timer timer;
size_t responses{0}; size_t responses{0};
m::feds::acquire(opts, [&timer, &responses, &buf, &out] m::feds::execute(opts, [&timer, &responses, &buf, &out]
(const auto &result) (const auto &result)
{ {
++responses; ++responses;

View file

@ -454,7 +454,7 @@ ircd::m::fetch::start(const m::room &room)
opts.op = feds::op::head; opts.op = feds::op::head;
opts.room_id = room.room_id; opts.room_id = room.room_id;
opts.closure_errors = false; opts.closure_errors = false;
feds::acquire feds::execute
{ {
opts, [](const auto &result) opts, [](const auto &result)
{ {

View file

@ -439,7 +439,7 @@ ircd::m::keys::get(const queries &queries,
} }
assert(opts.size() <= queries.size()); assert(opts.size() <= queries.size());
m::feds::acquire(opts, [&ret, &closure] m::feds::execute(opts, [&ret, &closure]
(const auto &result) (const auto &result)
{ {
if(empty(result.object)) if(empty(result.object))