mirror of
https://github.com/matrix-construct/construct
synced 2024-11-15 14:31:11 +01:00
ircd:Ⓜ️:fetch: Add a request count() to interface.
This commit is contained in:
parent
6b467733a8
commit
f5df386e1c
2 changed files with 15 additions and 0 deletions
|
@ -22,6 +22,7 @@ namespace ircd::m::fetch
|
|||
// Observers
|
||||
bool for_each(const std::function<bool (request &)> &);
|
||||
bool exists(const m::event::id &);
|
||||
size_t count();
|
||||
|
||||
// Control panel
|
||||
bool cancel(request &);
|
||||
|
|
|
@ -590,6 +590,20 @@ ircd::m::fetch::start(const m::room::id &room_id,
|
|||
return submit(event_id, room_id);
|
||||
}
|
||||
|
||||
size_t
|
||||
IRCD_MODULE_EXPORT
|
||||
ircd::m::fetch::count()
|
||||
{
|
||||
size_t ret(0);
|
||||
for_each([&ret](const auto &request)
|
||||
{
|
||||
++ret;
|
||||
return true;
|
||||
});
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool
|
||||
IRCD_MODULE_EXPORT
|
||||
ircd::m::fetch::for_each(const std::function<bool (request &)> &closure)
|
||||
|
|
Loading…
Reference in a new issue