Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/rfyiamcool/rocks_queue

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/rfyiamcool/rocks_queue

  • v0.0.0-20171129014409-b0ea04d41d21
  • Source
  • Go
  • Socket score

Version published
Created
Source

rocks_queue

使用rocksdb实现的高性能队列, 可引用到项目中使用.

怎么用

安装rocksdb存储引擎

https://github.com/facebook/rocksdb/blob/master/INSTALL.md

运行例子

git clone git@github.com:rfyiamcool/rocks_queue.git
cd rocks_queue
go run main.go

改进

  • 增加更多的redis指令.
  • 收敛代码, 去除其他的数据结构.

数据结构

表明类型为list队列

    key                               value

+queue_name,l                           1

list数据存储格式

                key                                    value

l[queue_name]\x01\x00\x00\x00\x00\x00\x00\x03   xiaorui.cc index: 945
l[queue_name]\x01\x00\x00\x00\x00\x00\x00\x03   xiaorui.cc index: 946
l[queue_name]\x01\x00\x00\x00\x00\x00\x00\x03   xiaorui.cc index: 947
l[queue_name]\x01\x00\x00\x00\x00\x00\x00\x03   xiaorui.cc index: 948
l[queue_name]\x01\x00\x00\x00\x00\x00\x00\x03   xiaorui.cc index: 949
l[queue_name]\x01\x00\x00\x00\x00\x00\x00\x03   xiaorui.cc index: 950

benchmark

push queue

190000 qps

pop queue

188000 qps

ChangeLog

  • v1.0 2017-11-28

计数改为内存计数,只在启动初始化时会扫描一次left、right

参考了约炮神器陌陌 { GoRedis半成品代码 }

FAQs

Package last updated on 29 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc