rustqueue 0.2.0

Background jobs without infrastructure — embeddable job queue with zero external dependencies
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Add background job processing to any Rust application in 3 lines of code. No Redis, no RabbitMQ, no external services. Just cargo add rustqueue.">
    <meta property="og:title" content="Background Jobs in Rust Without Redis">
    <meta property="og:description" content="Add background job processing to any Rust application in 3 lines. No Redis. No RabbitMQ. Just a library.">
    <meta property="og:type" content="article">
    <title>Background Jobs in Rust Without Redis | RustQueue</title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Manrope:wght@400;500;700;800&family=Syne:wght@500;700;800&display=swap" rel="stylesheet">
    <style>
:root {
    --bg: #f4f1e8;
    --surface: #fffdf8;
    --ink: #11242a;
    --muted: #52666d;
    --line: #d5ddd9;
    --accent: #0f9681;
    --accent-strong: #0a6b5e;
    --accent-alt: #e87337;
    --accent-alt-strong: #b55321;
    --shadow: 0 22px 44px rgba(17, 36, 42, 0.12);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Manrope", "Segoe UI", sans-serif;
    line-height: 1.45;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(17, 36, 42, 0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(17, 36, 42, 0.03) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.55), transparent 72%);
}

.scene {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.orb {
    position: absolute;
    filter: blur(36px);
    border-radius: 50%;
    opacity: 0.8;
    animation: drift 18s ease-in-out infinite;
}

.orb-a {
    width: 260px;
    height: 260px;
    top: 4%;
    left: -30px;
    background: rgba(15, 150, 129, 0.3);
}

.orb-b {
    width: 300px;
    height: 300px;
    top: 14%;
    right: -60px;
    background: rgba(232, 115, 55, 0.25);
    animation-delay: -6s;
}

.orb-c {
    width: 220px;
    height: 220px;
    bottom: 10%;
    left: 44%;
    background: rgba(15, 150, 129, 0.16);
    animation-delay: -11s;
}

.container {
    width: min(1120px, 92vw);
    margin-inline: auto;
}

.nav-shell {
    position: sticky;
    top: 0;
    z-index: 20;
    padding-top: 1rem;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(17, 36, 42, 0.1);
    background: rgba(255, 253, 248, 0.82);
    backdrop-filter: blur(8px);
    border-radius: 999px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
}

.logo-mark {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: linear-gradient(140deg, var(--accent), var(--accent-alt));
    box-shadow: 0 0 0 4px rgba(15, 150, 129, 0.15);
}

.logo-text {
    font-family: "Syne", "Trebuchet MS", sans-serif;
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.nav-links {
    display: inline-flex;
    align-items: center;
    gap: 1.1rem;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--ink);
}

.btn {
    border-radius: 999px;
    padding: 0.7rem 1.15rem;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.01em;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    color: #f8fffd;
    background: linear-gradient(120deg, var(--accent), var(--accent-alt));
    box-shadow: 0 12px 24px rgba(17, 36, 42, 0.18);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(17, 36, 42, 0.22);
}

.btn-ghost {
    color: var(--ink);
    background: rgba(255, 253, 248, 0.9);
    border: 1px solid rgba(17, 36, 42, 0.12);
}

.btn-ghost:hover {
    transform: translateY(-1px);
    border-color: rgba(17, 36, 42, 0.3);
}

.hero {
    margin-top: 3.2rem;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    align-items: start;
}

.eyebrow {
    margin: 0 0 0.65rem;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent-strong);
}

.hero h1,
.section-head h2,
.launch h2 {
    margin: 0;
    font-family: "Syne", "Trebuchet MS", sans-serif;
    line-height: 1;
}

.hero h1 {
    font-size: clamp(2.4rem, 6vw, 4.7rem);
    max-width: 12ch;
}

.hero h1 span {
    color: var(--accent-alt-strong);
}

.lead {
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.9vw, 1.2rem);
    max-width: 58ch;
}

.hero-cta {
    margin-top: 1.35rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.command-block {
    margin-top: 1.4rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    box-shadow: 0 6px 14px rgba(17, 36, 42, 0.05);
}

.mono {
    font-family: "JetBrains Mono", "Consolas", monospace;
}

.mono-label {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 0.4rem;
}

.signal-list {
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
}

.signal-list li::before {
    content: "";
    color: var(--accent);
    margin-right: 0.5rem;
    font-size: 0.8rem;
}

.hero-side {
    display: grid;
    gap: 1rem;
}

.panel {
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.panel h2 {
    margin: 0 0 0.8rem;
    font-size: 0.96rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.kpis {
    display: grid;
    gap: 0.7rem;
}

.kpis div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 150, 129, 0.08);
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
}

.kpis strong {
    font-size: 1.15rem;
}

.panel-events ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.panel-events li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.panel-events small {
    margin-left: auto;
    opacity: 0.85;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.dot.ok {
    background: #17a371;
}

.dot.warn {
    background: #d96a2f;
}

.features,
.use-cases,
.launch {
    margin-top: 5.8rem;
}

.section-head h2 {
    margin-top: 0.25rem;
    font-size: clamp(1.8rem, 3.2vw, 2.7rem);
    max-width: 18ch;
}

.feature-grid {
    margin-top: 1.4rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.card {
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    padding: 1rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(247, 243, 236, 0.85));
    transition: transform 180ms ease, border-color 180ms ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(15, 150, 129, 0.5);
}

.card h3 {
    margin: 0;
    font-family: "Syne", "Trebuchet MS", sans-serif;
    font-size: 1.2rem;
}

.card p {
    margin: 0.6rem 0 0;
    color: var(--muted);
}

.lane {
    margin-top: 1.4rem;
    display: grid;
    gap: 0.8rem;
}

.lane-item {
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.9);
    padding: 1rem 1rem 1rem 1.2rem;
    position: relative;
}

.lane-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 16px;
    bottom: 16px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent), var(--accent-alt));
}

.lane-item h3 {
    margin: 0;
    font-family: "Syne", "Trebuchet MS", sans-serif;
}

.lane-item p {
    margin: 0.45rem 0 0;
    color: var(--muted);
}

.launch {
    border-radius: var(--radius-lg);
    background: linear-gradient(155deg, #102b33, #0e4038);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e6fffa;
    padding: 1.6rem;
}

.launch .eyebrow {
    color: #86f3d8;
}

.launch h2 {
    max-width: 16ch;
    font-size: clamp(1.8rem, 3.6vw, 2.8rem);
}

.code {
    margin: 1rem 0 0;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(6, 20, 24, 0.65);
    padding: 1rem;
    overflow-x: auto;
}

.code code {
    margin: 0;
    font-family: "JetBrains Mono", "Consolas", monospace;
    color: #d0fff1;
    font-size: 0.86rem;
    line-height: 1.55;
}

.launch-actions {
    margin-top: 1.1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer {
    margin: 3.4rem auto 1.9rem;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    animation: reveal 860ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.hero-copy.reveal {
    animation-delay: 90ms;
}

.panel-queue.reveal {
    animation-delay: 230ms;
}

.panel-events.reveal {
    animation-delay: 360ms;
}

.feature-grid .card:nth-child(1) { animation-delay: 100ms; }
.feature-grid .card:nth-child(2) { animation-delay: 180ms; }
.feature-grid .card:nth-child(3) { animation-delay: 260ms; }
.feature-grid .card:nth-child(4) { animation-delay: 340ms; }
.feature-grid .card:nth-child(5) { animation-delay: 420ms; }
.feature-grid .card:nth-child(6) { animation-delay: 500ms; }
.feature-grid .card:nth-child(7) { animation-delay: 580ms; }
.feature-grid .card:nth-child(8) { animation-delay: 660ms; }
.feature-grid .card:nth-child(9) { animation-delay: 740ms; }

.lane .lane-item:nth-child(1) { animation-delay: 120ms; }
.lane .lane-item:nth-child(2) { animation-delay: 220ms; }
.lane .lane-item:nth-child(3) { animation-delay: 320ms; }
.lane .lane-item:nth-child(4) { animation-delay: 420ms; }

@keyframes reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes drift {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(0, -14px, 0) scale(1.06);
    }
}

@media (max-width: 980px) {
    .nav {
        border-radius: 18px;
        flex-wrap: wrap;
    }

    .nav-links {
        width: 100%;
        order: 3;
        justify-content: flex-start;
        overflow-x: auto;
        padding-top: 0.2rem;
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .container {
        width: min(1120px, 94vw);
    }

    .hero {
        margin-top: 2.2rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: clamp(2.1rem, 10vw, 2.9rem);
    }

    .section-head h2,
    .launch h2 {
        font-size: clamp(1.6rem, 9vw, 2.1rem);
    }

    .footer {
        flex-direction: column;
    }
}

/* ── Hero code block ────────────────────────────────────────────────── */
.hero-code {
    margin: 2rem 0;
    background: var(--ink);
    border-radius: var(--radius-sm);
    padding: 1.5rem 2rem;
    overflow-x: auto;
}

.hero-code pre {
    margin: 0;
}

.hero-code code {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #e2e8f0;
}

.hero-code .kw { color: #c792ea; }
.hero-code .str { color: #c3e88d; }
.hero-code .comment { color: #637777; font-style: italic; }

/* ── Growth path ────────────────────────────────────────────────────── */
.how-it-works {
    padding: 6rem 0;
}

.growth-path {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.growth-step {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 2rem;
}

.step-num {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.code-sm {
    background: var(--ink);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin-top: 1rem;
}

.code-sm code {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #e2e8f0;
}

/* ── Compare list ───────────────────────────────────────────────────── */
.compare-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.compare-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
}

.compare-list li:last-child {
    border-bottom: none;
}

.compare-list .muted {
    color: var(--muted);
}

.compare-list code {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8rem;
    color: var(--muted);
}
    </style>
    <style>
        .blog-header { margin-top: 2rem; margin-bottom: 3rem; }
        .blog-header h1 {
            font-family: "Syne", "Trebuchet MS", sans-serif;
            font-size: clamp(2rem, 5vw, 3.2rem);
            line-height: 1.1;
            max-width: 20ch;
        }
        .blog-meta {
            margin-top: 0.75rem;
            color: var(--muted);
            font-size: 0.9rem;
        }
        .blog-body { max-width: 72ch; }
        .blog-body h2 {
            font-family: "Syne", "Trebuchet MS", sans-serif;
            font-size: 1.6rem;
            margin: 2.5rem 0 0.75rem;
            line-height: 1.15;
        }
        .blog-body h3 {
            font-family: "Syne", "Trebuchet MS", sans-serif;
            font-size: 1.2rem;
            margin: 2rem 0 0.5rem;
        }
        .blog-body p { color: var(--muted); margin: 0.75rem 0; font-size: 1.05rem; line-height: 1.7; }
        .blog-body p strong { color: var(--ink); }
        .blog-body blockquote {
            border-left: 4px solid var(--accent);
            margin: 1.5rem 0;
            padding: 0.75rem 1.25rem;
            background: rgba(15, 150, 129, 0.06);
            border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
        }
        .blog-body blockquote p { font-style: italic; margin: 0; }
        .blog-code {
            background: var(--ink);
            border-radius: var(--radius-sm);
            padding: 1.25rem 1.5rem;
            overflow-x: auto;
            margin: 1.25rem 0;
        }
        .blog-code pre { margin: 0; }
        .blog-code code {
            font-family: "JetBrains Mono", monospace;
            font-size: 0.88rem;
            line-height: 1.65;
            color: #e2e8f0;
        }
        .blog-code .kw { color: #c792ea; }
        .blog-code .str { color: #c3e88d; }
        .blog-code .cm { color: #637777; font-style: italic; }
        .blog-code .fn { color: #82aaff; }
        .blog-code .mac { color: #89ddff; }
        .blog-table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.92rem; }
        .blog-table th, .blog-table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); text-align: left; }
        .blog-table th { font-weight: 700; color: var(--ink); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
        .blog-table td { color: var(--muted); }
        .blog-table td strong { color: var(--ink); }
        .blog-cta {
            margin: 3rem 0 2rem;
            padding: 2rem;
            border-radius: var(--radius-lg);
            background: linear-gradient(155deg, #102b33, #0e4038);
            color: #e6fffa;
            border: 1px solid rgba(255,255,255,0.2);
        }
        .blog-cta h2 { color: #e6fffa; margin: 0 0 0.5rem; font-family: "Syne", sans-serif; font-size: 1.6rem; }
        .blog-cta p { color: #86f3d8; margin: 0 0 1rem; }
        .blog-cta code { font-family: "JetBrains Mono", monospace; background: rgba(6,20,24,0.65); padding: 0.6rem 1rem; border-radius: var(--radius-sm); display: block; color: #d0fff1; font-size: 0.88rem; border: 1px solid rgba(255,255,255,0.15); }
    </style>
</head>
<body>
<div class="scene" aria-hidden="true">
    <div class="orb orb-a"></div>
    <div class="orb orb-b"></div>
    <div class="orb orb-c"></div>
</div>

<header class="nav-shell">
    <nav class="container nav">
        <a href="/rustqueue/" class="logo" aria-label="RustQueue home">
            <span class="logo-mark"></span>
            <span class="logo-text">RustQueue</span>
        </a>
        <div class="nav-links">
            <a href="/rustqueue/">Home</a>
            <a href="/rustqueue/blog/background-jobs-without-redis.html">Blog</a>
            <a href="https://github.com/ferax564/rustqueue">GitHub</a>
        </div>
        <a class="btn btn-ghost" href="https://github.com/ferax564/rustqueue">Open Dashboard</a>
    </nav>
</header>

<main class="container">
    <article class="blog-header">
        <p class="eyebrow">Launch Post</p>
        <h1>Background Jobs in Rust Without Redis</h1>
        <p class="blog-meta">March 29, 2026 &middot; RustQueue v0.2.0</p>
    </article>

    <div class="blog-body">

        <p><strong>What if adding background jobs to your Rust app was as simple as adding SQLite?</strong></p>

        <p>Every Rust web application eventually needs background job processing. Send welcome emails. Generate reports. Process uploads. Retry failed API calls. And the standard answer is always the same: install Redis, set up a queue library, run a separate worker process, configure monitoring, add Redis to your Docker Compose, your CI, your staging environment, your production...</p>

        <p>For most applications, that's overkill. You don't need a distributed message broker. You need a way to run tasks in the background that won't be lost if your process crashes.</p>

        <p>Today we're releasing <strong>RustQueue v0.2.0</strong> &mdash; and it does exactly that.</p>

        <h2>Three Lines of Code</h2>

        <div class="blog-code"><pre><code><span class="kw">let</span> rq = RustQueue::redb(<span class="str">"./jobs.db"</span>)?.build()?;
rq.push(<span class="str">"emails"</span>, <span class="str">"send-welcome"</span>, <span class="mac">json!</span>({<span class="str">"to"</span>: <span class="str">"user@a.com"</span>}), None).<span class="kw">await</span>?;

<span class="cm">// That's it. The job is persisted to disk. It survives crashes.</span></code></pre></div>

        <p>No Redis. No RabbitMQ. No Docker. No config file. No separate process. Just <code>cargo add rustqueue</code> and you have a persistent, crash-safe job queue embedded in your application.</p>

        <p>The job is written to an embedded ACID database (redb). If your process crashes mid-flight, the job is still there when you restart. Retries, exponential backoff, and a dead-letter queue are built in.</p>

        <h2>The Full Example</h2>

        <div class="blog-code"><pre><code><span class="kw">use</span> rustqueue::RustQueue;
<span class="kw">use</span> serde_json::<span class="mac">json!</span>;

#[tokio::main]
<span class="kw">async fn</span> <span class="fn">main</span>() -> anyhow::Result&lt;()&gt; {
    <span class="kw">let</span> rq = RustQueue::redb(<span class="str">"./jobs.db"</span>)?.build()?;

    <span class="cm">// Push a job</span>
    <span class="kw">let</span> id = rq.push(<span class="str">"emails"</span>, <span class="str">"send-welcome"</span>,
        <span class="mac">json!</span>({<span class="str">"to"</span>: <span class="str">"user@example.com"</span>}), None).<span class="kw">await</span>?;
    println!(<span class="str">"Queued: {id}"</span>);

    <span class="cm">// Pull and process</span>
    <span class="kw">let</span> jobs = rq.pull(<span class="str">"emails"</span>, 1).<span class="kw">await</span>?;
    println!(<span class="str">"Processing: {}"</span>, jobs[0].name);
    rq.ack(jobs[0].id, None).<span class="kw">await</span>?;

    Ok(())
}</code></pre></div>

        <p>Run it with <code>cargo run</code>. That's your first background job &mdash; processed, acknowledged, done. The <code>jobs.db</code> file persists everything. Kill the process, restart it, and your pending jobs are still there.</p>

        <h2>Adding Background Jobs to an Existing Axum App</h2>

        <p>Most Rust web apps are built on Axum. RustQueue v0.2.0 ships with a native Axum integration &mdash; the <code>RqState</code> extractor. Here's what it looks like to add background email processing to an existing web application:</p>

        <div class="blog-code"><pre><code><span class="kw">use</span> axum::routing::post;
<span class="kw">use</span> axum::{Json, Router};
<span class="kw">use</span> rustqueue::axum_integration::RqState;
<span class="kw">use</span> rustqueue::RustQueue;
<span class="kw">use</span> serde_json::<span class="mac">json!</span>;
<span class="kw">use</span> std::sync::Arc;

<span class="kw">async fn</span> <span class="fn">enqueue_email</span>(rq: RqState, Json(body): Json&lt;serde_json::Value&gt;)
    -> Json&lt;serde_json::Value&gt;
{
    <span class="kw">let</span> to = body[<span class="str">"to"</span>].as_str().unwrap_or(<span class="str">"unknown"</span>);
    <span class="kw">let</span> id = rq.push(<span class="str">"emails"</span>, <span class="str">"send-welcome"</span>,
        <span class="mac">json!</span>({<span class="str">"to"</span>: to}), None).<span class="kw">await</span>.unwrap();
    Json(<span class="mac">json!</span>({<span class="str">"queued"</span>: true, <span class="str">"job_id"</span>: id.to_string()}))
}

#[tokio::main]
<span class="kw">async fn</span> <span class="fn">main</span>() -> anyhow::Result&lt;()&gt; {
    <span class="kw">let</span> rq = Arc::new(RustQueue::redb(<span class="str">"./jobs.db"</span>)?.build()?);
    <span class="kw">let</span> app = Router::new()
        .route(<span class="str">"/send-email"</span>, post(enqueue_email))
        .with_state(rq);

    <span class="kw">let</span> listener = tokio::net::TcpListener::bind(<span class="str">"0.0.0.0:3000"</span>).<span class="kw">await</span>?;
    axum::serve(listener, app).<span class="kw">await</span>?;
    Ok(())
}</code></pre></div>

        <p>The <code>RqState</code> extractor handles everything. Add it as a handler parameter and call <code>.push()</code>, <code>.pull()</code>, <code>.ack()</code> directly. No setup, no wiring, no boilerplate.</p>

        <h2>Why Not Just Use Redis?</h2>

        <table class="blog-table">
            <thead>
                <tr><th></th><th>RustQueue</th><th>Redis + BullMQ</th><th>RabbitMQ</th><th>Celery</th></tr>
            </thead>
            <tbody>
                <tr><td>External deps</td><td><strong>None</strong></td><td>Redis server</td><td>Erlang + RabbitMQ</td><td>Redis/RabbitMQ</td></tr>
                <tr><td>Time to first job</td><td><strong>~60 seconds</strong></td><td>15&ndash;30 min</td><td>15&ndash;30 min</td><td>15&ndash;30 min</td></tr>
                <tr><td>Deployment</td><td><strong>cargo add</strong></td><td>2+ services</td><td>2+ services</td><td>3+ services</td></tr>
                <tr><td>Binary / footprint</td><td><strong>6.8 MB, 15 MB RAM</strong></td><td>N/A, ~100 MB+</td><td>N/A, ~100 MB+</td><td>N/A, ~200 MB+</td></tr>
                <tr><td>Crash recovery</td><td><strong>ACID</strong></td><td>Configurable</td><td>Yes</td><td>Depends</td></tr>
            </tbody>
        </table>

        <p>Redis is a fantastic tool. But running an entire Redis server just for background jobs is like renting a warehouse to store your grocery list. For most applications, an embedded queue that lives inside your process is the right abstraction.</p>

        <h2>Start Embedded. Grow Into a Server.</h2>

        <p>The best part: you're never locked in. When your application outgrows embedded mode, run the same engine as a standalone server &mdash; same data file, same guarantees, zero migration:</p>

        <div class="blog-code"><pre><code><span class="cm"># Day 1: embedded in your app</span>
<span class="kw">let</span> rq = RustQueue::redb(<span class="str">"./jobs.db"</span>)?.build()?;

<span class="cm"># Day 30: standalone server, same data</span>
$ rustqueue serve --storage ./jobs.db

<span class="cm"># Day 60: workers in any language</span>
<span class="kw">const</span> rq = <span class="kw">new</span> RustQueueClient(<span class="str">"http://localhost:6790"</span>);
<span class="kw">await</span> rq.push(<span class="str">"emails"</span>, <span class="str">"welcome"</span>, { to: <span class="str">"user@a.com"</span> });</code></pre></div>

        <p>Client SDKs for Node.js, Python, and Go are included &mdash; all zero-dependency. REST API, TCP protocol, WebSocket events, web dashboard, Prometheus metrics, Grafana dashboards &mdash; everything is built in.</p>

        <h2>Performance</h2>

        <p>Because we know you'll ask:</p>

        <table class="blog-table">
            <thead>
                <tr><th>System</th><th>Produce</th><th>Consume</th><th>End-to-end</th></tr>
            </thead>
            <tbody>
                <tr><td><strong>RustQueue TCP</strong></td><td><strong>47,129/s</strong></td><td><strong>38,048/s</strong></td><td><strong>22,685/s</strong></td></tr>
                <tr><td>RabbitMQ</td><td>47,588/s</td><td>5,367/s</td><td>4,686/s</td></tr>
                <tr><td>Redis</td><td>9,337/s</td><td>9,511/s</td><td>4,951/s</td></tr>
                <tr><td>BullMQ</td><td>7,559/s</td><td>6,690/s</td><td>1,978/s</td></tr>
                <tr><td>Celery</td><td>3,168/s</td><td>1,589/s</td><td>893/s</td></tr>
            </tbody>
        </table>

        <p>Neck-and-neck with RabbitMQ on produce. <strong>7.1x faster on consume. 4.8x faster end-to-end.</strong> With a 6.8 MB binary using 15 MB of RAM.</p>

        <p>But performance isn't the point. The point is that you shouldn't need to think about your job queue. It should be invisible infrastructure &mdash; like SQLite is for databases.</p>

        <blockquote>
            <p>Think of RustQueue not as a replacement for RabbitMQ, but as a replacement for tokio::spawn.</p>
        </blockquote>

        <h2>Production Features</h2>

        <p>This isn't a toy. RustQueue ships with everything you need for production:</p>

        <p><strong>Retries &amp; backoff</strong> &mdash; fixed, linear, or exponential. Jobs that exhaust retries land in a dead-letter queue for inspection.</p>
        <p><strong>Cron &amp; interval scheduling</strong> &mdash; built-in schedule engine with pause/resume.</p>
        <p><strong>DAG workflows</strong> &mdash; job dependencies with cycle detection and cascade failure.</p>
        <p><strong>Progress tracking</strong> &mdash; 0&ndash;100 progress with log messages and worker heartbeats.</p>
        <p><strong>Webhooks</strong> &mdash; HMAC-SHA256 signed HTTP callbacks on job events.</p>
        <p><strong>Observability</strong> &mdash; 15+ Prometheus metrics, pre-built Grafana dashboard, WebSocket event stream.</p>

        <h2>Get Started</h2>

        <div class="blog-cta">
            <h2>Your First Background Job in 60 Seconds</h2>
            <p>Add RustQueue to your project and push your first job:</p>
            <code>cargo add rustqueue tokio serde_json anyhow</code>
        </div>

        <p>Then check out the <a href="https://github.com/ferax564/rustqueue/tree/main/examples" style="color: var(--accent-strong); font-weight: 700;">examples</a>: basic push/pull/ack, persistent queues, worker loops, and a full Axum web app with background jobs.</p>

        <p>Star us on <a href="https://github.com/ferax564/rustqueue" style="color: var(--accent-strong); font-weight: 700;">GitHub</a>. We'd love to hear what you build.</p>

    </div>
</article>
</main>

<footer class="footer container">
    <p>RustQueue &middot; Background jobs without infrastructure</p>
    <p class="mono">MIT OR Apache-2.0</p>
</footer>
</body>
</html>