diff options
author | Valery Piashchynski <[email protected]> | 2020-10-19 14:01:59 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-10-19 14:01:59 +0300 |
commit | 77670fb7af0c892c9b3a589fd424534fad288e7a (patch) | |
tree | 3adcaa85db664a355abe2b28f1d7e4a3fc45689f /worker.go | |
parent | 16fbf3104c3c34bd9355593052b686acd26a8efe (diff) |
Update according activity worker
Diffstat (limited to 'worker.go')
-rw-r--r-- | worker.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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) } |