feudal/subjects/selector.go

33 lines
507 B
Go
Raw Permalink Normal View History

2024-05-05 07:33:44 +00:00
package subjects
import (
"feudal/message"
"feudal/feudal"
)
type Selector interface {
Select(path string)
Workers() WorkerCollection
Send(m message.Envelope)
}
type Selection struct {
workers feudal.Subjects
}
func NewSelector() Selector {
return &Selection{ workers: New() }
}
func (s *Selection) Select(path string) {
}
func (s *Selection) Send(m message.Envelope) {
s.workers.Send(m)
}
func (s *Selection) Workers() WorkerCollection {
return *s.workers.(*WorkerCollection)
}