Skip to content
Open source. No paid edition.v1.1.1 ↗

Background jobs for Go

Jobs go in raw.They come out done.

Retries, workflows, limits, recurring jobs and a dashboard, the way Hangfire does it for .NET. In the database you already have, in Redis, or in both.

EnqueuedProcessingSucceeded

0 done

A real queue would be less cute. Not by much.

02 / Where jobs live

Your database called.It wants a break.

Keep the jobs next to your data, move them to Redis, or do both: written in your transaction, run in Redis. Same code, one line changes.

Everything in one place

Jobs are rows next to your data. One system to run, and nothing acknowledged is ever lost.

  • Enqueue in your transaction
  • As durable as your database
  • Nothing else to run
0WAL bytes
0commits
0rows written

per job, measured on PostgreSQL 17

Measured, not estimated: 10,000 orders, one job each.Read the trade-offs

03 / Five minutes

A type, a handler,and you are done.

Arguments are Go types, so a typo is a compile error and not a job that fails at 3 a.m.

Getting started

main.go
type SendEmail struct {
	To string
}

func (SendEmail) Kind() string { return "send_email" }

func sendEmail(ctx context.Context, j *kiln.Job[SendEmail]) error {
	return mailer.Send(ctx, j.Args.To)
}

kiln.Handle(mux, sendEmail)
client.Enqueue(ctx, SendEmail{To: "ada@example.com"})

04 / The dashboard

Watch it work.Poke it when it does not.

Retry, cancel and requeue from a dashboard that comes with the library, in English or Brazilian Portuguese, mounted on your own HTTP server.

The kiln dashboard: jobs by state, throughput over the last hour, queues and serversThe kiln dashboard: jobs by state, throughput over the last hour, queues and servers

05 / We tried to break it

Twenty-four hours of chaos.Zero jobs lost.

0jobs run
0kill -9
0database restarts
0jobs lost
On a 2 vCPU droplet, with every limit held and nothing run more often than allowed.How it was measured

Go on.Throw something in.

MIT licensed. There is no paid edition.

Released under the MIT License.