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

A service creates multiple Disruptors #452

Open
wangshilong1996 opened this issue Mar 20, 2023 · 4 comments
Open

A service creates multiple Disruptors #452

wangshilong1996 opened this issue Mar 20, 2023 · 4 comments
Labels

Comments

@wangshilong1996
Copy link

wangshilong1996 commented Mar 20, 2023

Desktop (please complete the following information):

  • OS: [win10]
  • Version [e.g. 3.4.4]
  • JVM Version [1.8.0_221]

Additional context
image
image
image
image
Can I use Disruptor like this, and use new multiple instances in one service

@Palmr
Copy link
Member

Palmr commented Mar 20, 2023

Translations (courtesy of google translate):
Title = "A service creates multiple Disruptors "
Body= "Can I use Disruptor like this, and use new multiple instances in one service"

@wangshilong1996 wangshilong1996 changed the title 一个服务创建多个Disruptor A service creates multiple Disruptors Mar 21, 2023
@wangshilong1996
Copy link
Author

@Palmr Looking forward to your help

@Palmr Palmr added the question label Mar 21, 2023
@Palmr
Copy link
Member

Palmr commented Mar 21, 2023

@wangshilong1996 there should be no issues creating multiple instances of the Disruptor in once service.

From your code examples I could imagine a game server? In that case you may indeed want different queues per-game so that activity in one game does not affect the latency of another.

Hopefully that answers the question.

An aside: I see you're using handleEventsWithWorkerPool which is removed in Disruptor v4. Something to consider if it's a long-term project

@wangshilong1996
Copy link
Author

@Palmr During my testing, 6000 connections were tested, and I found that multiple instances had lost events, while one instance did not.

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

No branches or pull requests

2 participants