vend with

This commit is contained in:
bel
2026-06-27 16:44:47 -06:00
parent 48c3474c15
commit a9f78655c3
20 changed files with 1068 additions and 3 deletions
+32
View File
@@ -0,0 +1,32 @@
package main
import (
"context"
"flag"
"log"
"os"
"gitea.bel.blue/bel/with"
"gitea.bel.blue/bel/with/cmd/example-dbos/work"
"gitea.bel.blue/bel/with/dbos"
)
func main() {
if err := with.Context(run); err != nil {
log.Fatal(err)
}
}
func run(ctx context.Context) error {
fs := flag.NewFlagSet(os.Args[0], flag.ContinueOnError)
conn := fs.String("c", "", "postgresql://u:p@h:p/db")
gdedupe := fs.String("k1", "global-deduplication-key", "prevent ever re-evaluating this execution")
cdedupe := fs.String("k2", "concurrent-deduplication-key", "prevent re-evaluating this execution concurrently")
if err := fs.Parse(os.Args[1:]); err != nil {
return err
}
return dbos.QueueClient(ctx, *conn, "queue", func(c *dbos.Client) error {
return dbos.Go(ctx, c, work.Workflow, 1, *gdedupe, *cdedupe)
})
}