Files
yakpanel-core/control-plane-go/internal/orchestration/dispatcher.go

20 lines
393 B
Go
Raw Normal View History

2026-04-07 20:29:49 +05:30
package orchestration
import "yakpanel/control-plane-go/pkg/contracts"
type Queue interface {
Publish(topic string, payload any) error
}
type Dispatcher struct {
queue Queue
}
func NewDispatcher(queue Queue) *Dispatcher {
return &Dispatcher{queue: queue}
}
func (d *Dispatcher) DispatchCommand(cmd contracts.CommandEnvelope) error {
return d.queue.Publish("yakpanel.commands", cmd)
}