コード例 #1
0
ファイル: unboundedmailbox.go プロジェクト: yonglehou/gam
func NewUnboundedMailbox(throughput int) MailboxProducer {
	return func() Mailbox {
		userMailbox := queue.New(10)
		systemMailbox := queue.New(10)
		mailbox := unboundedMailbox{
			throughput:      throughput,
			userMailbox:     userMailbox,
			systemMailbox:   systemMailbox,
			hasMoreMessages: mailboxHasNoMessages,
			schedulerStatus: mailboxIdle,
		}
		return &mailbox
	}
}
コード例 #2
0
func newEndpointWriterMailbox(batchSize, initialSize int) actor.MailboxProducer {

	return func() actor.Mailbox {
		userMailbox := queue.New(initialSize)
		systemMailbox := queue.New(10)
		mailbox := endpointWriterMailbox{
			userMailbox:     userMailbox,
			systemMailbox:   systemMailbox,
			hasMoreMessages: mailboxHasNoMessages,
			schedulerStatus: mailboxIdle,
			batchSize:       batchSize,
		}
		return &mailbox
	}
}