1 Star 0 Fork 0

jack/protoactor-go

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
unbounded.go 754 Bytes
Copy Edit Raw Blame History
490689386@qq.com authored 2025-05-19 14:50 +08:00 . 初始化
package actor
import (
"gitee.com/wujianhai/protoactor-go/internal/queue/goring"
"gitee.com/wujianhai/protoactor-go/internal/queue/mpsc"
)
type unboundedMailboxQueue struct {
userMailbox *goring.Queue
}
func (q *unboundedMailboxQueue) Push(m interface{}) {
q.userMailbox.Push(m)
}
func (q *unboundedMailboxQueue) Pop() interface{} {
m, o := q.userMailbox.Pop()
if o {
return m
}
return nil
}
// Unbounded returns a producer which creates an unbounded mailbox
func Unbounded(mailboxStats ...MailboxMiddleware) MailboxProducer {
return func() Mailbox {
q := &unboundedMailboxQueue{
userMailbox: goring.New(10),
}
return &defaultMailbox{
systemMailbox: mpsc.New(),
userMailbox: q,
middlewares: mailboxStats,
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wujianhai/protoactor-go.git
git@gitee.com:wujianhai/protoactor-go.git
wujianhai
protoactor-go
protoactor-go
5633fe2499dd

Search