-
-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: adding a message handler while handling a message does not cause…
… concurrency exceptions
- Loading branch information
Showing
1 changed file
with
3 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
import java.util.List; | ||
import java.util.concurrent.ArrayBlockingQueue; | ||
import java.util.concurrent.BlockingQueue; | ||
import java.util.concurrent.CopyOnWriteArrayList; | ||
|
||
/** | ||
* @author Almas Baimagambetov ([email protected]) | ||
|
@@ -30,8 +31,8 @@ public abstract class Connection<T> { | |
|
||
private PropertyMap localSessionData = new PropertyMap(); | ||
|
||
protected final List<MessageHandler<T>> messageHandlers = new ArrayList<>(); | ||
protected final List<MessageHandler<T>> messageHandlersFX = new ArrayList<>(); | ||
protected final List<MessageHandler<T>> messageHandlers = new CopyOnWriteArrayList<>(); | ||
protected final List<MessageHandler<T>> messageHandlersFX = new CopyOnWriteArrayList<>(); | ||
|
||
protected BlockingQueue<T> messageQueue = new ArrayBlockingQueue<>(100); | ||
|
||
|