Started worker instruction handling via Execute() method
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
package worker
|
package worker
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"sync"
|
"sync"
|
||||||
@@ -25,10 +26,14 @@ type SessionController interface {
|
|||||||
CloseSession(id uuid.UUID) error
|
CloseSession(id uuid.UUID) error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Instruction struct{}
|
||||||
|
|
||||||
type Worker interface {
|
type Worker interface {
|
||||||
Start(workerID uuid.UUID, controller SessionController, cfg []byte) error
|
Start(workerID uuid.UUID, controller SessionController, cfg []byte) error
|
||||||
Stop() error
|
Stop() error
|
||||||
|
|
||||||
|
Execute(ctx context.Context, inst Instruction) error
|
||||||
|
|
||||||
IsRunning() bool
|
IsRunning() bool
|
||||||
ID() uuid.UUID
|
ID() uuid.UUID
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user