mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd::server: Add conf items for existing todos.
This commit is contained in:
parent
a9b87a5c09
commit
4df13f5d4f
3 changed files with 47 additions and 27 deletions
|
@ -15,6 +15,9 @@
|
|||
///
|
||||
struct ircd::server::link
|
||||
{
|
||||
static conf::item<size_t> tag_max_default;
|
||||
static conf::item<size_t> tag_commit_max_default;
|
||||
|
||||
bool init {false}; ///< link is connecting
|
||||
bool fini {false}; ///< link is disconnecting
|
||||
bool exclude {false}; ///< link is excluded
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
struct ircd::server::node
|
||||
:std::enable_shared_from_this<ircd::server::node>
|
||||
{
|
||||
static conf::item<size_t> link_min_default;
|
||||
static conf::item<size_t> link_max_default;
|
||||
|
||||
net::remote remote;
|
||||
std::list<link> links;
|
||||
std::exception_ptr eptr;
|
||||
|
@ -45,8 +48,8 @@ struct ircd::server::node
|
|||
|
||||
public:
|
||||
// config related
|
||||
size_t link_max() const;
|
||||
size_t link_min() const;
|
||||
size_t link_max() const;
|
||||
|
||||
// stats for all links in node
|
||||
size_t link_count() const;
|
||||
|
|
|
@ -12,24 +12,6 @@
|
|||
|
||||
namespace ircd::server
|
||||
{
|
||||
// Coarse maximum number of connections to a server
|
||||
const size_t LINK_MAX_DEFAULT
|
||||
{
|
||||
2
|
||||
};
|
||||
|
||||
// Coarse minimum number of connections to a server
|
||||
const size_t LINK_MIN_DEFAULT
|
||||
{
|
||||
1
|
||||
};
|
||||
|
||||
// Maximum number of requests "in flight" at a time in one pipe.
|
||||
const size_t TAG_COMMIT_MAX_DEFAULT
|
||||
{
|
||||
2
|
||||
};
|
||||
|
||||
ctx::dock dock;
|
||||
|
||||
template<class F> size_t accumulate_nodes(F&&);
|
||||
|
@ -284,6 +266,24 @@ ircd::server::submit(const hostport &hostport,
|
|||
// node
|
||||
//
|
||||
|
||||
decltype(ircd::server::node::link_min_default)
|
||||
ircd::server::node::link_min_default
|
||||
{
|
||||
{ "name", "ircd.server.node.link_min" },
|
||||
{ "default", 1L }
|
||||
};
|
||||
|
||||
decltype(ircd::server::node::link_max_default)
|
||||
ircd::server::node::link_max_default
|
||||
{
|
||||
{ "name", "ircd.server.node.link_max" },
|
||||
{ "default", 2L }
|
||||
};
|
||||
|
||||
//
|
||||
// node::node
|
||||
//
|
||||
|
||||
ircd::server::node::node()
|
||||
{
|
||||
}
|
||||
|
@ -884,16 +884,14 @@ size_t
|
|||
ircd::server::node::link_min()
|
||||
const
|
||||
{
|
||||
//TODO: conf
|
||||
return LINK_MIN_DEFAULT;
|
||||
return link_min_default;
|
||||
}
|
||||
|
||||
size_t
|
||||
ircd::server::node::link_max()
|
||||
const
|
||||
{
|
||||
//TODO: conf
|
||||
return LINK_MAX_DEFAULT;
|
||||
return link_max_default;
|
||||
}
|
||||
|
||||
template<class F>
|
||||
|
@ -926,6 +924,24 @@ const
|
|||
// link
|
||||
//
|
||||
|
||||
decltype(ircd::server::link::tag_max_default)
|
||||
ircd::server::link::tag_max_default
|
||||
{
|
||||
{ "name", "ircd.server.link.tag_max" },
|
||||
{ "default", -1L }
|
||||
};
|
||||
|
||||
decltype(ircd::server::link::tag_commit_max_default)
|
||||
ircd::server::link::tag_commit_max_default
|
||||
{
|
||||
{ "name", "ircd.server.link.tag_commit_max" },
|
||||
{ "default", 3L }
|
||||
};
|
||||
|
||||
//
|
||||
// link::link
|
||||
//
|
||||
|
||||
ircd::server::link::link(server::node &node)
|
||||
:node{shared_from(node)}
|
||||
{
|
||||
|
@ -1497,16 +1513,14 @@ size_t
|
|||
ircd::server::link::tag_commit_max()
|
||||
const
|
||||
{
|
||||
//TODO: config
|
||||
return TAG_COMMIT_MAX_DEFAULT;
|
||||
return tag_commit_max_default;
|
||||
}
|
||||
|
||||
size_t
|
||||
ircd::server::link::tag_max()
|
||||
const
|
||||
{
|
||||
//TODO: config
|
||||
return -1;
|
||||
return tag_max_default;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue