-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.go
33 lines (26 loc) · 922 Bytes
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package goactor
import (
"github.com/hedisam/goactor/internal/intlpid"
"github.com/hedisam/goactor/internal/relations"
"time"
)
type Mailbox interface {
Receive(msgHandler, sysMsgHandler func(interface{}) bool) error
ReceiveWithTimeout(timeout time.Duration, msgHandler, sysMsgHandler func(interface{}) bool) error
PushMessage(msg interface{}) error
PushSystemMessage(msg interface{}) error
Dispose()
}
type relationManager interface {
AddLink(pid intlpid.InternalPID) error
RemoveLink(pid intlpid.InternalPID) error
AddMonitored(pid intlpid.InternalPID) error
RemoveMonitored(pid intlpid.InternalPID) error
LinkedActors() *relations.RelationIterator
MonitorActors() *relations.RelationIterator
RelationType(pid intlpid.InternalPID) relations.RelationType
Dispose()
}
type ActorFunc func(actor *Actor)
type MailboxBuilderFunc func() Mailbox
type MessageHandler func(message interface{}) (loop bool)