Skip to content

Commit

Permalink
fix: adding a message handler while handling a message does not cause…
Browse files Browse the repository at this point in the history
… concurrency exceptions
  • Loading branch information
AlmasB committed May 6, 2023
1 parent 557035e commit d44c647
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fxgl-io/src/main/java/com/almasb/fxgl/net/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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);

Expand Down

0 comments on commit d44c647

Please sign in to comment.