// NewMailbox creates a fixed capacity mailbox.
// The minimum capacity is 1.
NewMailbox creates a fixed capacity mailbox.
The minimum capacity is 1.
// NewMailbox creates a fixed capacity mailbox . // The minimum capacity is 1 .
func NewMailbox(id ID, cap int) Mailbox {
	if cap <= 0 {
		cap = 1
	}
	return &mailbox{
		id:      id,
		msgCh:   make(chan message.Message, cap),
		closeCh: make(chan struct{}),
		state:   mailboxStateRunning,
	}
}
func NewMailbox ( id ID , cap int ) Mailbox { if cap <= 0 { cap = 1 } return & mailbox { id : id , msgCh : make ( chan message . Message , cap ) , closeCh : make ( chan struct { } ) , state : mailboxStateRunning , } }
NewMailbox creates a fixed capacity mailbox.
NewMailbox creates a fixed capacity mailbox .