From 77670fb7af0c892c9b3a589fd424534fad288e7a Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Mon, 19 Oct 2020 14:01:59 +0300 Subject: Update according activity worker --- worker.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'worker.go') diff --git a/worker.go b/worker.go index 82bd99df..c0a735c2 100644 --- a/worker.go +++ b/worker.go @@ -24,7 +24,7 @@ const ( EventWorkerLog // EventWorkerWaitDone triggered when worker exit from process Wait - EventWorkerWaitDone + EventWorkerWaitDone // todo: implemented? EventWorkerBufferClosed @@ -61,6 +61,7 @@ type WorkerBase interface { // Start used to run Cmd and immediately return Start() error + // Wait must be called once for each WorkerProcess, call will be released once WorkerProcess is // complete and will return process error (if any), if stderr is presented it's value // will be wrapped as WorkerError. Method will return error code if php process fails @@ -69,11 +70,14 @@ type WorkerBase interface { // Stop sends soft termination command to the WorkerProcess and waits for process completion. Stop(ctx context.Context) error + // Kill kills underlying process, make sure to call Wait() func to gather // error log from the stderr. Does not waits for process completion! Kill(ctx context.Context) error + // Relay returns attached to worker goridge relay Relay() goridge.Relay + // AttachRelay used to attach goridge relay to the worker process AttachRelay(rl goridge.Relay) } -- cgit v1.2.3