Queue

Driver#

DriverBehavior
syncExecutes named jobs immediately
memoryIn-process workers, retries/backoff, delayed dispatch
databasePersistent MySQL/PostgreSQL jobs, reservation, retries, failed jobs

Project defaults:

DOTENV
QUEUE_DRIVER=memory
QUEUE_WORKERS=1
QUEUE_POLL_SECONDS=1
QUEUE_BACKOFF_SECONDS=1

Use the database driver for production jobs that must survive application restarts.

Named job#

BASH
ctg make:job SendWelcomeEmail

Named jobs are registered in the project registry. Dispatch them from application code using an available context:

GO
queue.DispatchNamed(ctx, "SendWelcomeEmail", queue.Payload{
    "user_id": 42,
})

Import github.com/arfajhf/copytygo/v5/queue. Delayed jobs use queue.DispatchOptions. Executing arbitrary Go background jobs requires Native Runtime; Lite has the limits described upstream.


Versioned sources v5.0.0: README.md · docs/ARCHITECTURE.md · queue/queue.go.

Search documentation

Type to search the documentation.