Jobs (Core)
Enqueue now, later or at a time; retries with backoff, a dead letter queue, sealed fields, unique keys, schedules and worker middleware.
JoobQ Core queues and jobs, JoobQ Pro workflows, and the JoobQUI console that runs them on your own Redis and PostgreSQL.
Start here
Start here
Run it on your own PostgreSQL and Redis, and keep it healthy.
Read the guide →Start here
What JoobQ is, what it costs to run, and who controls what.
Read the guide →One job, nine languages
A job is a named handler on a queue, defined once with its retries; a returned value completes it, an exception fails it. Pick a language: the choice holds on every page of this site.
struct ConfJob
include JoobQ::Job
@queue = QUEUE
@retries = 3
@max_retries = 3
@expires = 1.day.from_now.to_unix_ms@job("conf.context", queue=QUEUE)
def context_job(payload, ctx):
report(ctx, "context", payload, app_marker=ctx.app.marker, tenant=ctx.context.get("tenant_id"), x=payload.get("x"))defineJob<App>({ name: 'conf.context', queue: QUEUE, perform: async (p, ctx) =>
report(ctx, 'context', p, { app_marker: ctx.app.marker, tenant: ctx.context.tenant_id, x: p.x }) }),class ContextJob
include JoobQ::Job
job_name "conf.context"
queue QUEUE
def self.perform(p, ctx) = report(ctx, "context", p, app_marker: ctx.app.marker, tenant: ctx.context["tenant_id"], x: p["x"])
endjoobq.DefineJob[*App]("conf.context", opts, func(p map[string]any, ec *EC) (any, error) {
return report(ec, "context", p, map[string]any{"app_marker": ec.App.Marker, "tenant": ec.Meta["tenant_id"], "x": p["x"]})
}),JobDef::new("conf.context", queue.clone(), |p: Value, ctx: &Ctx| {
report(ctx, "context", &p, json!({"app_marker": ctx.app.marker, "tenant": ctx.context.get("tenant_id"), "x": p["x"]}))
}),JobDefinition.<App>of("conf.context", QUEUE, 3, (p, ctx) ->
report(ctx, "context", p, map("app_marker", ctx.app().marker, "tenant", ctx.context().get("tenant_id"), "x", m(p).get("x")))),final class ContextJob extends ConfJob
{
public static function jobName(): string { return 'conf.context'; }
public static function perform(array $p, ExecutionContext $ctx): mixed
{
return report($ctx, 'context', $p, ['app_marker' => $ctx->app->marker, 'tenant' => $ctx->context['tenant_id'] ?? null, 'x' => $p['x'] ?? null]);
}
}JobDefinition<App>.Define("conf.context", Queue, 3, (p, ctx) =>
Report(ctx, "context", p, new() { ["app_marker"] = ctx.App.Marker, ["tenant"] = ctx.Context.GetValueOrDefault("tenant_id")?.GetValue<string>(), ["x"] = Num(p?["x"]) })),Tested against a real server in every language shown.
Then a worker connects to the server's SDK gateway with the origin and the SDK token and long-polls for tasks: SDKs: install and connect.
The console

