replicator-queue.h revision 593bf2d333dc67e9d9e6552273332157793731c0
#ifndef REPLICATOR_QUEUE_H
#define REPLICATOR_QUEUE_H
#include "priorityq.h"
#include "replication-common.h"
struct replicator_user {
struct priorityq_item item;
char *username;
char *state;
/* last time this user's state was updated */
/* last_fast_run is always >= last_full_run. */
enum replication_priority priority;
/* User isn't currently in replication queue */
unsigned int popped:1;
/* Last replication sync failed */
unsigned int last_sync_failed:1;
};
void *context);
/* Add a user to queue and return it. If the user already exists, it's updated
only if the new priority is higher. */
struct replicator_user *
enum replication_priority priority);
const char *username,
void *context);
/* Remove user from replication queue and free it. */
struct replicator_user **user);
/* Return the next user from replication queue, and remove it from the queue.
If there's nothing to be replicated currently, returns NULL and sets
next_secs_r to when there should be more work to do. */
struct replicator_user *
unsigned int *next_secs_r);
/* Add user back to queue. */
struct replicator_user *user);
#endif