{"modulePath":"github.com/code19m/taskmill","version":"v0.18.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package main\n\nCommand tutorial is the program that the reader of the tutorial, docs/tutorial, has built after part 7: the shop of the quickstart, grown into one binary with two roles. The web role takes orders and shows the dashboard. The worker role sends receipts and reminders, builds a report every minute, and publishes order events through the outbox.\n\n\tdocker run --name taskmill-pg -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres:18\n\tgo run ./examples/tutorial worker\n\tgo run ./examples/tutorial web\n\nBoth roles read the database from DATABASE\\_URL, by default the one that the docker command above starts. The web role listens on ADDR, by default localhost:8080, with the dashboard at [http://localhost:8080/taskmill/](http://localhost:8080/taskmill/). The worker role answers its readiness probe on HEALTH\\_ADDR, by default localhost:8081. Ctrl-C stops a role.\n\n## Types\n\n```go\ntype BuildReport struct{}\n```\nBuildReport builds the sales report. A schedule enqueues it every minute.\n\n```go\nfunc (BuildReport) Kind() string\n```\nKind names the task.\n\n```go\ntype RemindCustomer struct {\n\tOrderID int64  `json:\"order_id\"`\n\tEmail   string `json:\"email\"`\n}\n```\nRemindCustomer asks a customer how the order went.\n\n```go\nfunc (RemindCustomer) Kind() string\n```\nKind names the task.\n\n```go\ntype SendReceipt struct {\n\tOrderID int64  `json:\"order_id\"`\n\tEmail   string `json:\"email\"`\n}\n```\nSendReceipt is a task: a Go struct, saved as JSON, with a Kind method.\n\n```go\nfunc (SendReceipt) EnqueueDefaults() taskmill.EnqueueOptions\n```\nEnqueueDefaults puts receipts in a queue of their own, and gives up on one after 5 attempts.\n\n```go\nfunc (SendReceipt) Kind() string\n```\nKind names the task. It tells taskmill which handler runs it.\n\n","path":"github.com/code19m/taskmill/examples/tutorial","name":"main","synopsis":"Command tutorial is the program that the reader of the tutorial, docs/tutorial, has built after part 7: the shop of the quickstart, grown into one binary with two roles.","isRedistributable":true}
