lib/server: send query results in batches

Instead of one message (header) at a time, send batches of them; this allows for
much faster handling in mu4e.
This commit is contained in:
Dirk-Jan C. Binnema
2021-10-21 19:19:21 +03:00
parent e46347aa54
commit f17995b113
2 changed files with 45 additions and 28 deletions

View File

@ -178,6 +178,11 @@ struct Sexp {
return *this;
}
/**
* Remove all elements from the list.
*/
void clear() { seq_.clear(); }
/**
* Get the number of elements in the list
*
@ -192,7 +197,7 @@ struct Sexp {
*/
size_t empty() const { return seq_.empty(); }
private:
private:
friend struct Sexp;
Seq seq_;
};
@ -292,7 +297,7 @@ struct Sexp {
return is_prop_list(list().begin() + 1, list().end());
};
private:
private:
Sexp(Type typearg, std::string&& valuearg) : type_{typearg}, value_{std::move(valuearg)}
{
if (is_list())