Comments (1)
Hello, sorry for the delayed response.
should some time-consuming operations not be directly related to the framework, such as EventHandler processing logic should not be involved in processing some database interactions and long process processing?
I think you're asking if it's okay to have blocking operations in EventHandlers?
If so, the answer is yes, there is no hard rule against blocking operations like database interactions.
The main point of the Disruptor is a queue, it can buffer up events while slower consumers handle those events.
Obviously if the rate events get inserted into the buffer is sustained at a higher rate than the consumers handle them, eventually it will wrap and you'll have to decide what to do about that.
But if the buffer is appropriately sized, and the event rate is bursty, this may be a perfectly fine thing to do.
Is the so-called super-high concurrency only for the data distribution of the data structure itself?
Yes, the high performance low latency mentioned on this project is just about the Disruptor. You can still write slow code using it, and you don't have to be aiming for high performance. But if you do want high performance inter-thread messaging, this library is unlikely to be your bottleneck. And if it is, there's not many alternatives out there that are as fast or faster.
What is the most appropriate scenario for us to use this framework in general?
Passing events between threads.
An example might be a service with a thread for receiving network events and deserialising them, that might pass those events to an application logic thread which does some work before sending out via multiple other threads to different network sockets.
In the above example you might use a Disruptor ringbuffer to buffer the events between all the threads, since the application logic in the middle will typically run at a different rate to threads dealing with blocking IO on the network. The buffers may help you cope with temporary blocking and give you other options to rewind and re-send events should packets go missing.
from disruptor.
Related Issues (20)
- [Question] How to test batch behavior? HOT 5
- remove redundant judgment
- `EventHandler::setSequenceCallback` will not play well with `RewindableException` throwing event handlers
- Add a maximum batch size to the `BatchEventProcessor`
- lmax library compatibility with Java 11 and Java 17 HOT 1
- `Util.log2` gets stuck in endless loop for negative values
- 4.0 is based on JDK11. Will the JDK8-based 3.x version continue to be released? HOT 1
- Can a new 3.X version be released based on 3.4.4? HOT 3
- 4.0.0.RC1 has been released for more than one year. When will another stable version be released?
- please guide me,thanks. HOT 1
- A service creates multiple Disruptors HOT 4
- Unable to set disruptor as singleton HOT 2
- Directly replace Fence with the methods setRelease, setVolatile, and getAcquire. No need to set barriers via VarHandle HOT 1
- FixedSequenceGroup What does this class do? HOT 1
- BlockingWaitStrategy CPU 100% HOT 2
- SequenceBarrier.waitForSequence sometimes doesn't respect BlockingWaitStrategy
- Lmax Disruptor Version 4.0.0 with MultiProducers blocks in ringbuffer.next() call HOT 1
- Problem Using LMAX Disruptor 4.0.0 with JDBC-postgres 42.6.0 HOT 4
- Java 21 and log4j HOT 1
- In version 4.x, is there a successor to Disruptor::handleEventsWithWorkerPool? Can multiple consumers cooperate to process a batch of messages? (one message will only be processed by one consumer) HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from disruptor.