diff options
Diffstat (limited to 'pkg/worker/sync_worker.go')
-rwxr-xr-x | pkg/worker/sync_worker.go | 17 |
1 files changed, 2 insertions, 15 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") |