前一久看到一篇文章美团高性能队列——Disruptor,时候自己琢磨了一下;经过反复修改,实现了一个相似的无锁队列EsQueue,该无锁队列相对Disruptor,而言少了队列数量属性quantity的CAP操作,因此性能杠杠的,在测试环境:windows10,Core(TM) i5-3320M CPU 2.6G, 8G 内存,go1.8.3,下性能达到1460-1
Fetch the package from GitHub: go get github.com/beeker1121/goque Import to your project: import"github.com/beeker1121/goque" Usage Stack Stack is a LIFO (last in, first out) data structure. Create or open a stack: s,err:=goque.OpenStack("data_dir")...defers.Close() ...
package main import ( "context" "encoding/json" "fmt" "time" amqp "github.com/rabbitmq/amqp091-go" "github.com/bxcodec/goqueue" "github.com/bxcodec/goqueue/consumer" "github.com/bxcodec/goqueue/interfaces" "github.com/bxcodec/goqueue/middleware" "github.com/bxcodec/goqueue/options" co...
consumer:job消费者,通过 reserve/release/bury/delete 来获取 job 或改变 job 的状态; 很幸运的是官方提供了 go client:https://github.com/beanstalkd/go-beanstalk。 但是这对不熟悉beanstalkd操作的 go开发者而言,需要学习成本。 kafka 类似基于kafka消息队列作为存储的方案,存储单元是消息,如果要实现延时执行,可...
.github _example images .gitignore LICENSE Makefile README.md example_test.go go.mod go.sum options.go options_test.go rabbitmq.go rabbitmq_test.go rabbitmq Exchanges and Exchange Types See the consumer code: packagemainimport("context""encoding/json""flag""fmt""time""github.com/appleboy...
[E:/Work/GoLang/src/github.com/yireyun/go-queue/examples/pprof2] go1.8.3 amd64, Grp: 1, Times: 10000000, miss: 0, use: 631.3087ms, 63ns/op go1.8.3 amd64, Grp: 2, Times: 20000000, miss: 0, use: 998.7187ms, 49ns/op
Redis Streams as backend for Queue Package. Contribute to golang-queue/redisdb-stream development by creating an account on GitHub.
package main import ( "fmt" "github.com/AkihiroSuda/go-netfilter-queue" "os" ) func main() { var err error nfq, err := netfilter.NewNFQueue(0, 100, netfilter.NF_DEFAULT_PACKET_SIZE) if err != nil { fmt.Println(err) os.Exit(1) } defer nfq.Close() packets := nfq.GetPackets(...
package main import ( "fmt" "github.com/adrianbrad/queue" ) func main() { elems := []int{2, 3} blockingQueue := queue.NewBlocking(elems, queue.WithCapacity(3)) containsTwo := blockingQueue.Contains(2) fmt.Println(containsTwo) // true size := blockingQueue.Size() fmt.Println(size...
Tencent CMQ Golang SDK. Contribute to summer11123/cmq-go development by creating an account on GitHub.