33 lines
507 B
Go
33 lines
507 B
Go
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)
|
|
}
|