asynqmon/example_test.go

20 lines
406 B
Go
Raw Permalink Normal View History

2021-10-03 10:04:21 +08:00
package asynqmon_test
import (
"log"
"net/http"
"github.com/hibiken/asynq"
"github.com/hibiken/asynqmon"
)
func ExampleHTTPHandler() {
2021-10-04 23:18:00 +08:00
h := asynqmon.New(asynqmon.Options{
RootPath: "/monitoring",
2021-10-03 10:04:21 +08:00
RedisConnOpt: asynq.RedisClientOpt{Addr: ":6379"},
})
http.Handle(h.RootPath(), h)
log.Fatal(http.ListenAndServe(":8000", nil)) // visit localhost:8000/monitoring to see asynqmon homepage
2021-10-03 10:04:21 +08:00
}