FlexiQ
Construct the client and the full producer/admin API.
Construct the client and the full producer/admin API.
import org.byteveda.flexiq.FlexiQ;
try (FlexiQ flexiq = FlexiQ.builder().sqlite("flexiq.db").open()) {
// ...
}FlexiQ is AutoCloseable; close() releases the native storage handle.
The FlexiQ API is split across several pages for readability:
| Method | Description |
|---|---|
backend(String) | "sqlite" (default) | "postgres" | "redis". |
url(String) | Connection string: a file path for SQLite, a URL for Postgres/Redis. |
sqlite() / sqlite(path) / postgres(url) / redis(url) | Backend shortcuts. SQLite defaults to .flexiq/flexiq.db. |
poolSize(int) | Connection pool size (SQLite/Postgres). |
schema(String) | Postgres schema (default flexiq). |
prefix(String) | Redis key prefix. |
namespace(String) | Namespace applied to enqueued jobs + the worker scheduler. |
serializer(Serializer) | Payload/result serializer (default JsonSerializer). |
codec(PayloadCodec...) | Global codec chain around the serializer. |
codec(String, PayloadCodec) | Register a named codec for per-task selection (Task.codecs). |
open() | Open the native backend → FlexiQ. |
open(QueueBackend) | Open over an explicit backend (e.g. a test fake). |
| Method | Description |
|---|---|
enqueue(Task<T>, T) / enqueue(Task<T>, T, EnqueueOptions) | Enqueue a typed payload → job id. |
enqueue(String taskName, Object payload) | Enqueue by task name. |
tryEnqueue(...) | Gate-aware enqueue: Optional.empty() when a gate skips; a Reject still throws. |
enqueueMany(Task<T>, List<T>) / (..., EnqueueOptions) | Batch-enqueue in one storage call → ids in input order, uniqueKey entries deduped. |
enqueueAll(Task<T>, List<T>) | Alias of enqueueMany. |