0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 08:42:34 +01:00

modules/client/sync: Tweak log message format; cleanup longpoll::accepted struct.

This commit is contained in:
Jason Volk 2019-03-17 13:18:33 -07:00
parent 2158d3e7b6
commit 9ab3549660
2 changed files with 35 additions and 33 deletions

View file

@ -400,10 +400,10 @@ try
log::debug
{
log, "request %s linear last:%lu complete:%b @%lu",
log, "request %s linear last:%lu %s@%lu",
loghead(data),
last,
completed,
completed? "complete "_sv : string_view{},
next
};
@ -665,7 +665,7 @@ ircd::m::sync::longpoll::handle(data &data,
log::debug
{
log, "request %s longpoll got:%lu complete @%lu",
log, "request %s longpoll hit:%lu complete @%lu",
loghead(data),
event.event_idx,
next

View file

@ -34,36 +34,7 @@ namespace ircd::m::sync
namespace ircd::m::sync::longpoll
{
struct accepted
:m::event
{
json::strung strung;
std::string client_txnid;
event::idx event_idx;
accepted(const m::vm::eval &eval)
:strung
{
*eval.event_
}
,client_txnid
{
eval.copts?
eval.copts->client_txnid:
string_view{}
}
,event_idx
{
eval.sequence
}
{
const json::object object{this->strung};
static_cast<m::event &>(*this) = m::event{object};
}
accepted(accepted &&) = default;
accepted(const accepted &) = delete;
};
struct accepted;
size_t polling {0};
std::deque<accepted> queue;
@ -75,6 +46,37 @@ namespace ircd::m::sync::longpoll
extern m::hookfn<m::vm::eval &> notified;
}
struct ircd::m::sync::longpoll::accepted
:m::event
{
json::strung strung;
std::string client_txnid;
event::idx event_idx;
accepted(const m::vm::eval &eval)
:strung
{
*eval.event_
}
,client_txnid
{
eval.copts?
eval.copts->client_txnid:
string_view{}
}
,event_idx
{
eval.sequence
}
{
const json::object object{this->strung};
static_cast<m::event &>(*this) = m::event{object};
}
accepted(accepted &&) = default;
accepted(const accepted &) = delete;
};
struct ircd::m::sync::args
{
static conf::item<milliseconds> timeout_max;