From 45933eb6b0143767aba3cb668e5a6994b5e05c2a Mon Sep 17 00:00:00 2001 From: Ken Hibino Date: Wed, 15 Apr 2020 07:30:59 -0700 Subject: [PATCH] Reword doc comments --- doc.go | 6 +++--- server.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc.go b/doc.go index ab8a51b..aaaaa0c 100644 --- a/doc.go +++ b/doc.go @@ -14,7 +14,7 @@ specify the options using one of RedisConnOpt types. DB: 3, } -The Client is used to register a task to be processed at the specified time. +The Client is used to enqueue a task to be processed at the specified time. Task is created with two parameters: its type and payload. @@ -27,7 +27,7 @@ Task is created with two parameters: its type and payload. // Enqueue the task to be processed immediately. err := client.Enqueue(t) - // Schedule the task to be processed in one minute. + // Schedule the task to be processed after one minute. err = client.EnqueueIn(time.Minute, t) The Server is used to run the background task processing with a given @@ -38,7 +38,7 @@ handler. srv.Run(handler) -Handler is an interface with one method ProcessTask which +Handler is an interface type with a method which takes a task and returns an error. Handler should return nil if the processing is successful, otherwise return a non-nil error. If handler panics or returns a non-nil error, the task will be retried in the future. diff --git a/server.go b/server.go index 8f5a8ed..bdd9cc2 100644 --- a/server.go +++ b/server.go @@ -258,7 +258,7 @@ var ErrServerStopped = errors.New("asynq: the server has been stopped") // a signal, it gracefully shuts down all active workers and other // goroutines to process the tasks. // -// Run returns any error encountered during server boot time. +// Run returns any error encountered during server startup time. // If the server has already been stopped, ErrServerStopped is returned. func (srv *Server) Run(handler Handler) error { if err := srv.Start(handler); err != nil { @@ -274,7 +274,7 @@ func (srv *Server) Run(handler Handler) error { // Tasks are processed concurrently by the workers up to the number of // concurrency specified at the initialization time. // -// Start returns any error encountered during server boot time. +// Start returns any error encountered during server startup time. // If the server has already been stopped, ErrServerStopped is returned. func (srv *Server) Start(handler Handler) error { if handler == nil {