From c57232ae2bc7253ded326226948dfc7f9b324753 Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Sun, 28 Jan 2018 14:35:07 +0300 Subject: golint --- worker.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'worker.go') diff --git a/worker.go b/worker.go index 851239f9..d505c54b 100644 --- a/worker.go +++ b/worker.go @@ -148,7 +148,7 @@ func (w *Worker) Wait() error { return &exec.ExitError{ProcessState: w.endState} } -// Destroy sends soft termination command to the worker to properly stop the process. +// Stop sends soft termination command to the worker and waits for process completion. func (w *Worker) Stop() error { select { case <-w.waitDone: @@ -166,7 +166,7 @@ func (w *Worker) Stop() error { } // Kill kills underlying process, make sure to call Wait() func to gather -// error log from the stderr +// error log from the stderr. Waits for process completion. func (w *Worker) Kill() error { select { case <-w.waitDone: @@ -183,6 +183,9 @@ func (w *Worker) Kill() error { } } +// Exec sends payload to worker, executes it and returns result or +// error. Make sure to handle worker.Wait() to gather worker level +// errors. Method might return JobError indicating issue with payload. func (w *Worker) Exec(rqs *Payload) (rsp *Payload, err error) { w.mu.Lock() defer w.mu.Unlock() -- cgit v1.2.3