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_priority.go 931 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"
)
func NewPriorityGoringQueue() *priorityQueue {
return NewPriorityQueue(func() queue {
return &unboundedMailboxQueue{
userMailbox: goring.New(10),
}
})
}
//goland:noinspection ALL
func UnboundedPriority(mailboxStats ...MailboxMiddleware) MailboxProducer {
return func() Mailbox {
return &defaultMailbox{
systemMailbox: mpsc.New(),
userMailbox: NewPriorityGoringQueue(),
middlewares: mailboxStats,
}
}
}
func NewPriorityMpscQueue() *priorityQueue {
return NewPriorityQueue(func() queue {
return mpsc.New()
})
}
func UnboundedPriorityMpsc(mailboxStats ...MailboxMiddleware) MailboxProducer {
return func() Mailbox {
return &defaultMailbox{
systemMailbox: mpsc.New(),
userMailbox: NewPriorityMpscQueue(),
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