d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainen#ifndef WORKER_POOL_H
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainen#define WORKER_POOL_H
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainen
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainen#include "indexer.h"
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainen
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainenstruct worker_connection;
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainen
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainenstruct worker_pool *
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainenworker_pool_init(const char *socket_path, indexer_status_callback_t *callback);
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainenvoid worker_pool_deinit(struct worker_pool **pool);
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainen
df26373d0aa3cb208da213fce32e2abc5d97f90bTimo Sirainenbool worker_pool_have_busy_connections(struct worker_pool *pool);
df26373d0aa3cb208da213fce32e2abc5d97f90bTimo Sirainen
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainenbool worker_pool_get_connection(struct worker_pool *pool,
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainen struct worker_connection **conn_r);
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainenvoid worker_pool_release_connection(struct worker_pool *pool,
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainen struct worker_connection *conn);
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainen
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainenstruct worker_connection *
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainenworker_pool_find_username_connection(struct worker_pool *pool,
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainen const char *username);
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainen
d9e404180ff26dbbaea68534a5f176765022b76bTimo Sirainen#endif