vend with
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"gitea.bel.blue/bel/with"
|
||||
"gitea.bel.blue/bel/with/cmd/example-dbos/work"
|
||||
mydbos "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")
|
||||
if err := fs.Parse(os.Args[1:]); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return mydbos.QueueWorker(ctx, *conn, "queue", func(w *mydbos.Worker) error {
|
||||
mydbos.Can(w, work.Workflow)
|
||||
return w.Listen(ctx)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user