Started worker instruction handling via Execute() method

This commit is contained in:
2025-09-23 02:08:03 +08:00
parent 740d9e3af6
commit 775853cef8

View File

@@ -3,6 +3,7 @@
package worker
import (
"context"
"errors"
"log/slog"
"sync"
@@ -25,10 +26,14 @@ type SessionController interface {
CloseSession(id uuid.UUID) error
}
type Instruction struct{}
type Worker interface {
Start(workerID uuid.UUID, controller SessionController, cfg []byte) error
Stop() error
Execute(ctx context.Context, inst Instruction) error
IsRunning() bool
ID() uuid.UUID
}