mirror of
https://github.com/matrix-construct/construct
synced 2025-03-16 22:41:46 +01:00
ircd::client: Rename the client request pool.
This commit is contained in:
parent
3be110d6ca
commit
f7813f61a5
2 changed files with 23 additions and 23 deletions
|
@ -34,7 +34,7 @@ struct ircd::client
|
|||
|
||||
static struct settings settings;
|
||||
static struct conf default_conf;
|
||||
static ctx::pool context;
|
||||
static ctx::pool pool;
|
||||
static uint64_t ctr; // monotonic
|
||||
|
||||
static void interrupt_all();
|
||||
|
|
|
@ -37,7 +37,7 @@ ircd::client::settings::pool_size
|
|||
}, []
|
||||
{
|
||||
using client = ircd::client;
|
||||
client::context.set(client::settings::pool_size);
|
||||
client::pool.set(client::settings::pool_size);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -84,7 +84,7 @@ ircd::client::default_conf
|
|||
/// a stack from this pool. The request handling and response logic can then be written
|
||||
/// in a synchronous manner as if each connection had its own thread.
|
||||
ircd::ctx::pool
|
||||
ircd::client::context
|
||||
ircd::client::pool
|
||||
{
|
||||
"client", size_t(settings.stack_size)
|
||||
};
|
||||
|
@ -150,23 +150,23 @@ ircd::client::init::wait()
|
|||
void
|
||||
ircd::client::spawn()
|
||||
{
|
||||
context.add(size_t(settings.pool_size));
|
||||
pool.add(size_t(settings.pool_size));
|
||||
}
|
||||
|
||||
void
|
||||
ircd::client::interrupt_all()
|
||||
{
|
||||
if(context.active())
|
||||
if(pool.active())
|
||||
log::warning
|
||||
{
|
||||
"Terminating %zu active of %zu client request contexts; %zu pending; %zu queued",
|
||||
context.active(),
|
||||
context.size(),
|
||||
context.pending(),
|
||||
context.queued()
|
||||
pool.active(),
|
||||
pool.size(),
|
||||
pool.pending(),
|
||||
pool.queued()
|
||||
};
|
||||
|
||||
context.terminate();
|
||||
pool.terminate();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -201,14 +201,14 @@ ircd::client::close_all()
|
|||
void
|
||||
ircd::client::wait_all()
|
||||
{
|
||||
if(context.active())
|
||||
if(pool.active())
|
||||
log::dwarning
|
||||
{
|
||||
"Waiting on %zu active of %zu client request contexts; %zu pending; %zu queued.",
|
||||
context.active(),
|
||||
context.size(),
|
||||
context.pending(),
|
||||
context.queued()
|
||||
pool.active(),
|
||||
pool.size(),
|
||||
pool.pending(),
|
||||
pool.queued()
|
||||
};
|
||||
|
||||
while(!client::list.empty())
|
||||
|
@ -221,13 +221,13 @@ ircd::client::wait_all()
|
|||
log::debug
|
||||
{
|
||||
"Joining %zu active of %zu client request contexts; %zu pending; %zu queued",
|
||||
context.active(),
|
||||
context.size(),
|
||||
context.pending(),
|
||||
context.queued()
|
||||
pool.active(),
|
||||
pool.size(),
|
||||
pool.pending(),
|
||||
pool.queued()
|
||||
};
|
||||
|
||||
context.join();
|
||||
pool.join();
|
||||
}
|
||||
|
||||
ircd::parse::read_closure
|
||||
|
@ -387,14 +387,14 @@ ircd::handle_client_ready(std::shared_ptr<client> client,
|
|||
std::bind(ircd::handle_client_request, std::move(client))
|
||||
};
|
||||
|
||||
if(client::context.avail() == 0)
|
||||
if(client::pool.avail() == 0)
|
||||
log::dwarning
|
||||
{
|
||||
"Client context pool exhausted. %zu requests queued.",
|
||||
client::context.queued()
|
||||
client::pool.queued()
|
||||
};
|
||||
|
||||
client::context(std::move(handler));
|
||||
client::pool(std::move(handler));
|
||||
}
|
||||
|
||||
/// A request context has been dispatched and is now handling this client.
|
||||
|
|
Loading…
Add table
Reference in a new issue