Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

貌似你的撮合只实现了价格优先,没有实现时间优先 #2

Open
yaojixiang1975 opened this issue Jun 14, 2019 · 3 comments

Comments

@yaojixiang1975
Copy link

No description provided.

@qyvlik
Copy link
Owner

qyvlik commented Jun 14, 2019

@yaojixiang1975 redis 内部不支持自定义排序,所以比较难在 redis 中实现严格意义上的撮合优先规则。

@yaojixiang1975
Copy link
Author

用zset就可以。zset首先是分数排序,分数相同的按字典顺序排序。 member不能直接用order_id,可以用一个20位serial_id,不足补0. serial_id 买的订单是递增, 卖的订单是递减。 通过serial_id可以映射order_id

@qyvlik
Copy link
Owner

qyvlik commented Jun 15, 2019

@yaojixiang1975 有空试试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants