当前位置:网站首页>Disruptor本地线程队列_使用transProcessor处理器和WorkPool两种方式进行消费对比---线程间通信工作笔记005
Disruptor本地线程队列_使用transProcessor处理器和WorkPool两种方式进行消费对比---线程间通信工作笔记005
2022-06-26 19:49:00 【脑瓜凉】

然后我们再来看,这里的
EventProcessor消息处理器,和
WorkerPool消息处理器

可以看到我们说这个EventProdessor可以看作是生产者,用来生产数据的
WorkProcessor是消费者对吧,而一个WorkerPool可以说是一个线程池,而一个个的
WorkProcessor就是消费用的线程.可以看到多个WorkProcessor同时消费的时候,可以保证,
同一个sequence不被多个WorkProcessor消费

可以看到上面这个Trade就是交易的意思,我们现在用Disruptor来处理交易数据
可以看到有id 订单编号,有name,有price价格对吧还有个AtomicInteger这个 count先不用管
这个Trade就相当于我们之前说的Event,就是代表数据对吧.

数据Trade肯定需要有个Factory,来生产trade数据,这里我们直接在main中生产trade
首先buffer_size是环形缓冲区大小
边栏推荐
- Micro service single sign on system (SSO)
- Tiktok practice ~ homepage video ~ pull-down refresh
- Filebeat安装及使用
- Kubernetes resource topology aware scheduling optimization
- MySQL stored procedure
- 股票开户的具体步骤是什么?网上开户安全吗?
- Installation and use of filebeat
- Can I open an account online? Is it safe?
- 阿里云个人镜像仓库日常基本使用
- Selection of database paradigm and main code
猜你喜欢

Tree array

Redis single sign on system + voting system

Tiktok practice ~ search page ~ scan QR code

mongoDB的三种基础备份方法

Kubernetes 资源拓扑感知调度优化

50 lines of code to crawl TOP500 books and import TXT documents

Introduction to single chip microcomputer one-on-one learning strategy, independent development program immediately after reading

Super VRT

抖音实战~搜索页面~扫描二维码

Microservice architecture
随机推荐
Tiktok practice ~ search page ~ scan QR code
物联网协议的王者:MQTT
Case description: the competition score management system needs to count the competition scores obtained by previous champions and record them in the file. The system has the following requirements: -
uni-app使用canvas绘制二维码
Basic and necessary common plug-ins of vscade
Solve com mysql. jdbc. exceptions. jdbc4.MySQLNonTransientConnectionException: Could not create connection
Résolution du problème: la machine virtuelle n'a pas pu copier et coller le fichier
阿里云个人镜像仓库日常基本使用
知识点总结
Solidity - contract inheritance sub contract contains constructor errors and one contract calls the view function of another contract to charge gas fees
MySQL recharge
关于Qt数据库开发的一些冷知识
Bonne Recommandation: développer des outils de sécurité pour les terminaux mobiles
Three basic backup methods of mongodb
Selection of database paradigm and main code
Deep learning: numpy
Separate save file for debug symbols after strip
[recommended collection] these 8 common missing value filling skills must be mastered
飞天+CIPU体为元宇宙带来更大想象空间
The goal you specified requires a project to execute but there is no POM