#ifndef INDEXER_QUEUE_H
#define INDEXER_QUEUE_H
#include "indexer.h"
struct indexer_request {
char *username;
char *mailbox;
char *session_id;
unsigned int max_recent_msgs;
/* index messages in this mailbox */
/* optimize this mailbox */
/* currently indexing this mailbox */
/* after indexing is finished, add this request back to the queue and
reindex it (i.e. a new indexing request came while we were
working.) */
/* when working finished, call this number of contexts and leave the
rest to the reindexing. */
unsigned int working_context_idx;
};
/* The callback is called whenever a new request is added to the queue. */
void (*callback)(struct indexer_queue *));
const char *session_id, unsigned int max_recent_msgs,
void *context);
void *context);
/* Return the next request from the queue, without removing it. */
/* Remove the next request from the queue. You must call
indexer_queue_request_finish() to free its memory. */
/* Give a status update about how far the indexing is going on. */
struct indexer_request *request,
int percentage);
/* Start working on a request */
/* Finish the request and free its memory. */
struct indexer_request **request,
bool success);
#endif