mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-03 07:13:02 +00:00
refactor: rename queue based load leveling
This commit is contained in:
1 parent
f71aa867ac
commit
0d35b4a1a9
16 files changed
+6
-2
No files matched your search
@@ -139,7 +139,7 @@
|
||||
<module>page-object</module>
|
||||
<module>event-based-asynchronous</module>
|
||||
<module>event-queue</module>
|
||||
<module>queue-load-leveling</module>
|
||||
<module>queue-based-load-leveling</module>
|
||||
<module>object-mother</module>
|
||||
<module>data-bus</module>
|
||||
<module>converter</module>
|
||||
|
||||
@@ -48,7 +48,9 @@ First, let's look at the `MessageQueue` and `Message` classes. The `MessageQueue
|
||||
public class Message {
|
||||
// Message details
|
||||
}
|
||||
```
|
||||
|
||||
```java
|
||||
public class MessageQueue {
|
||||
private Queue<Message> queue;
|
||||
|
||||
@@ -72,6 +74,7 @@ Next, we have the `TaskGenerator` class. This class represents the task producer
|
||||
|
||||
```java
|
||||
public class TaskGenerator implements Runnable {
|
||||
|
||||
private MessageQueue msgQueue;
|
||||
private int taskCount;
|
||||
|
||||
@@ -94,6 +97,7 @@ The `ServiceExecutor` class represents the task consumer. It retrieves tasks fro
|
||||
|
||||
```java
|
||||
public class ServiceExecutor implements Runnable {
|
||||
|
||||
private MessageQueue msgQueue;
|
||||
|
||||
public ServiceExecutor(MessageQueue msgQueue) {
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -32,7 +32,7 @@
|
||||
<artifactId>java-design-patterns</artifactId>
|
||||
<version>1.26.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>queue-load-leveling</artifactId>
|
||||
<artifactId>queue-based-load-leveling</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user