diff options
Diffstat (limited to 'pkg/worker')
-rwxr-xr-x | pkg/worker/sync_worker.go | 17 | ||||
-rwxr-xr-x | pkg/worker/worker.go | 3 |
2 files changed, 2 insertions, 18 deletions
diff --git a/pkg/worker/sync_worker.go b/pkg/worker/sync_worker.go index 304c40d6..82a5462a 100755 --- a/pkg/worker/sync_worker.go +++ b/pkg/worker/sync_worker.go @@ -13,32 +13,19 @@ import ( ) // Allocator is responsible for worker allocation in the pool -type Allocator func() (*SyncWorkerImpl, error) +type Allocator func() (SyncWorker, error) type SyncWorkerImpl struct { process *Process } // From creates SyncWorker from BaseProcess -func From(process *Process) *SyncWorkerImpl { +func From(process *Process) SyncWorker { return &SyncWorkerImpl{ process: process, } } -// FromSync creates BaseProcess from SyncWorkerImpl -func FromSync(w *SyncWorkerImpl) BaseProcess { - return &Process{ - created: w.process.created, - events: w.process.events, - state: w.process.state, - cmd: w.process.cmd, - pid: w.process.pid, - endState: w.process.endState, - relay: w.process.relay, - } -} - // Exec payload without TTL timeout. func (tw *SyncWorkerImpl) Exec(p payload.Payload) (payload.Payload, error) { const op = errors.Op("sync_worker_exec") diff --git a/pkg/worker/worker.go b/pkg/worker/worker.go index c315cb2d..0f7ab755 100755 --- a/pkg/worker/worker.go +++ b/pkg/worker/worker.go @@ -40,9 +40,6 @@ type Process struct { // can be nil while process is not started. pid int - // contains information about resulted process state. - endState *os.ProcessState - // communication bus with underlying process. relay relay.Relay } |