From f7548d6d28c313cf80e6f3ef89aed16a19815df1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 11:51:24 +0200 Subject: Adding upstream version 1:2.3.19.1+dfsg1. Signed-off-by: Daniel Baumann --- src/indexer/worker-connection.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/indexer/worker-connection.h (limited to 'src/indexer/worker-connection.h') diff --git a/src/indexer/worker-connection.h b/src/indexer/worker-connection.h new file mode 100644 index 0000000..e664c7e --- /dev/null +++ b/src/indexer/worker-connection.h @@ -0,0 +1,36 @@ +#ifndef WORKER_CONNECTION_H +#define WORKER_CONNECTION_H + +#include "indexer.h" + +struct indexer_request; +struct connection_list; + +typedef void worker_available_callback_t(void); + +struct connection * +worker_connection_create(const char *socket_path, + indexer_status_callback_t *callback, + worker_available_callback_t *avail_callback, + struct connection_list *list); +void worker_connection_destroy(struct connection *conn); + +struct connection_list *worker_connection_list_create(void); + +/* Returns TRUE if worker is connected to (not necessarily handshaked yet) */ +bool worker_connection_is_connected(struct connection *conn); + +/* Returns the last process_limit returned by a worker connection handshake. + If no handshakes have been received yet, returns 0. */ +unsigned int worker_connections_get_process_limit(void); + +/* Send a new indexing request for username+mailbox. The status callback is + called as necessary. Requests can be queued, but only for the same + username. */ +void worker_connection_request(struct connection *conn, + struct indexer_request *request); +/* Returns username of the currently pending requests, + or NULL if there are none. */ +const char *worker_connection_get_username(struct connection *conn); + +#endif -- cgit v1.2.3