filed

Job queue using FUSE

git clone git://mccd.space/filed

commit 118db8254dfd129c591527aaa67ac3b84fb12de4
parent 6b46d57c98d799442fcd138a5a58596b5064a5c3
Author: Marc Coquand <marc@coquand.email>
Date:   Sun, 14 Dec 2025 14:55:15 +0100

Rename to qj

Diffstat:
M.gitignore | 2+-
MREADME.md | 20++++++++++----------
Mgo.mod | 2+-
Mmain.go | 6+++---
Mmanager.go | 2+-
Mnewid.go | 2+-
Aqj.1.scd | 28++++++++++++++++++++++++++++
Dtbd.1.scd | 28----------------------------
8 files changed, 45 insertions(+), 45 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -1 +1 @@
-tbd
+qj
diff --git a/README.md b/README.md
@@ -1,6 +1,6 @@
-# tbd - Minimal job queue
+# qj - Queue jobs
 
-`tbd` is a simple job queue that is manipulated using files. It is great for single-server level workloads and features:
+`qj` is a simple job queue that is manipulated using files. It is intended for single-server workloads and features:
 
 - Retries
 - Output logs
@@ -14,11 +14,11 @@ Other features are enabled by using built-in Unix features:
 
 ## Installation
 
-`tbd` is built in Go.
+`qj` is built in Go and depends on fuse (make sure fusermount is available in path).
 
 ```
-git clone https://sr.ht/~marcc/tbd/
-cd tbd
+git clone https://sr.ht/~marcc/qj/
+cd qj
 go build
 ```
 
@@ -28,14 +28,14 @@ go build
 
 ```
 $ # In terminal one
-$ mkdir /tmp/tbd-jobs
-$ tbd /tmp/tbd-jobs /tmp/tbd-state.db
+$ mkdir /tmp/qj-jobs
+$ qj /tmp/qj-jobs /tmp/qj-state.db
 ```
 
 In terminal two:
 
 ```
-$ printf "echo 'Running job'" >> /tmp/tbd-jobs/pending/1
+$ printf "echo 'Running job'" >> /tmp/qj-jobs/pending/1
 ```
 
 Note: Each job name must be unique. See man pages for examples to generate an ID.
@@ -45,11 +45,11 @@ Note: Each job name must be unique. See man pages for examples to generate an ID
 By default, a job retries 3 times.
 
 ```
-$ mv /tmp/tbd-jobs/failed/1 /tmp/tbd-jobs/pending
+$ mv /tmp/qj-jobs/failed/1 /tmp/qj-jobs/pending
 ```
 
 ### Inspect job logs
 
 ```
-$ cat /tmp/tbd-jobs/active/1
+$ cat /tmp/qj-jobs/active/1
 ```
diff --git a/go.mod b/go.mod
@@ -1,4 +1,4 @@
-module mccd/tbd
+module qj
 
 go 1.24.4
 
diff --git a/main.go b/main.go
@@ -6,9 +6,9 @@ import (
 	"flag"
 	"fmt"
 	"log/slog"
-	"mccd/tbd/store"
 	"os"
 	"os/exec"
+	"qj/store"
 	"runtime"
 	"syscall"
 
@@ -44,8 +44,8 @@ func main() {
 	slog.Info("Mounting filesystem", "mountpoint", mountpoint)
 	c, err := fuse.Mount(
 		mountpoint,
-		fuse.FSName("tbd"),
-		fuse.Subtype("tbdfs"),
+		fuse.FSName("qj"),
+		fuse.Subtype("qjfs"),
 		fuse.AllowOther(),
 		fuse.DefaultPermissions(),
 	)
diff --git a/manager.go b/manager.go
@@ -5,8 +5,8 @@ import (
 	"context"
 	"fmt"
 	"log/slog"
-	"mccd/tbd/store"
 	"os/exec"
+	"qj/store"
 	"sync"
 	"time"
 )
diff --git a/newid.go b/newid.go
@@ -4,8 +4,8 @@ import (
 	"context"
 	"log/slog"
 	"math/rand"
-	"mccd/tbd/store"
 	"os"
+	"qj/store"
 	"time"
 
 	"bazil.org/fuse"
diff --git a/qj.1.scd b/qj.1.scd
@@ -0,0 +1,28 @@
+qj(1)
+
+# NAME
+
+qj - Simple job queue
+
+# SYNOPSIS
+
+*qj* _MOUNTPOINT_ _DBPATH_
+
+# DESCRIPTION
+
+qj is a simple job queue that operates using files by setting up a virtual
+file system on _MOUNTPOINT_.
+
+qj exposes 4 directories: *pending*, *active*, *failed*, *completed*. Files
+in the directories correspond to jobs. To create a job, simply add it to *pending*. 
+See examples.
+
+# EXAMPLES
+
+Create a new job with $JOBID that calculates 1+1:
+
+	$ JOBID="Big Number $(head -c4 /dev/urandom | base64)"
+	$ echo "echo 1+1 | bc -s" >> "/var/qj/pending/$JOBID"
+
+Periodic jobs can be set up using _CRON(8)_.
+
diff --git a/tbd.1.scd b/tbd.1.scd
@@ -1,28 +0,0 @@
-tbd(1)
-
-# NAME
-
-tbd - Simple job queue
-
-# SYNOPSIS
-
-*tbd* _MOUNTPOINT_ _DBPATH_
-
-# DESCRIPTION
-
-tbd is a simple job queue that operates using files by setting up a virtual
-file system on _MOUNTPOINT_.
-
-tbd exposes 4 directories: *pending*, *active*, *failed*, *completed*. Files
-in the directories correspond to jobs. To create a job, simply add it to *pending*. 
-See examples.
-
-# EXAMPLES
-
-Create a new job with $JOBID that calculates 1+1:
-
-	$ JOBID="Big Number $(head -c4 /dev/urandom | base64)"
-	$ echo "echo 1+1 | bc -s" >> "/var/tbd/pending/$JOBID"
-
-Periodic jobs can be set up using _CRON(8)_.
-