mirror of
https://github.com/hibiken/asynq.git
synced 2025-09-19 05:17:30 +08:00
Change Server API
* Rename ServerStatus to ServerState internally * Rename terminate to shutdown internally * Update Scheduler API to match Server API
This commit is contained in:
@@ -30,7 +30,7 @@ func ExampleServer_Run() {
|
||||
}
|
||||
}
|
||||
|
||||
func ExampleServer_Stop() {
|
||||
func ExampleServer_Shutdown() {
|
||||
srv := asynq.NewServer(
|
||||
asynq.RedisClientOpt{Addr: ":6379"},
|
||||
asynq.Config{Concurrency: 20},
|
||||
@@ -47,10 +47,10 @@ func ExampleServer_Stop() {
|
||||
signal.Notify(sigs, unix.SIGTERM, unix.SIGINT)
|
||||
<-sigs // wait for termination signal
|
||||
|
||||
srv.Stop()
|
||||
srv.Shutdown()
|
||||
}
|
||||
|
||||
func ExampleServer_Quiet() {
|
||||
func ExampleServer_Stop() {
|
||||
srv := asynq.NewServer(
|
||||
asynq.RedisClientOpt{Addr: ":6379"},
|
||||
asynq.Config{Concurrency: 20},
|
||||
@@ -70,13 +70,13 @@ func ExampleServer_Quiet() {
|
||||
for {
|
||||
s := <-sigs
|
||||
if s == unix.SIGTSTP {
|
||||
srv.Quiet() // stop processing new tasks
|
||||
srv.Stop() // stop processing new tasks
|
||||
continue
|
||||
}
|
||||
break
|
||||
break // received SIGTERM or SIGINT signal
|
||||
}
|
||||
|
||||
srv.Stop()
|
||||
srv.Shutdown()
|
||||
}
|
||||
|
||||
func ExampleScheduler() {
|
||||
|
Reference in New Issue
Block a user