24#ifndef __CWIST_DURABLE_QUEUE_H__
25#define __CWIST_DURABLE_QUEUE_H__
struct cwist_nats cwist_nats_t
struct cwist_redis cwist_redis_t
Single Redis connection handle.
const char * cwist_job_id(const cwist_job_t *job)
Return the backend entry id of the job, or NULL for a NULL job.
cwist_job_queue_t * cwist_job_queue_create_redis(cwist_redis_t *conn, const cwist_job_queue_opts_t *opts)
Create a durable queue over an existing Redis connection.
void cwist_job_queue_destroy(cwist_job_queue_t *q)
Destroy a queue and all backend resources it owns; NULL is a no-op. In-flight jobs are not touched.
const void * cwist_job_payload(const cwist_job_t *job, size_t *len)
Return the job payload pointer and store its length in len (0 on NULL job).
cwist_error_t cwist_job_queue_ack(cwist_job_queue_t *q, cwist_job_t *job)
Acknowledge a claimed job and free it.
cwist_error_t cwist_job_queue_enqueue(cwist_job_queue_t *q, const void *payload, size_t payload_len, const char *type)
Persist a job for later processing.
struct cwist_job_queue_opts cwist_job_queue_opts_t
void cwist_job_destroy(cwist_job_t *job)
Public alias of cwist_job_free(); releases a job returned by claim.
struct cwist_job_queue cwist_job_queue_t
cwist_error_t cwist_job_queue_nack(cwist_job_queue_t *q, cwist_job_t *job)
Return a claimed job to the queue.
uint32_t cwist_job_attempts(const cwist_job_t *job)
Return the delivery attempt count of the job (0 for a NULL job).
const char * cwist_job_type(const cwist_job_t *job)
Return the job type string, or NULL if none / NULL job.
struct cwist_job cwist_job_t
cwist_error_t cwist_job_queue_dead_count(cwist_job_queue_t *q, uint64_t *out_count)
Store the number of dead-lettered jobs in *out_count.
cwist_error_t cwist_job_queue_claim(cwist_job_queue_t *q, uint64_t timeout_ms, cwist_job_t **job)
Claim one job, waiting up to timeout_ms.
cwist_job_queue_t * cwist_job_queue_create_nats(cwist_nats_t *nats, const cwist_job_queue_opts_t *opts)
Create a durable queue over an existing NATS connection.
Integrated error structure used throughout the system.
uint64_t visibility_timeout_ms
Unified error code and type definitions for the CWIST system layer.