mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-10 13:49:04 +01:00
Use a MpscGrowableArrayQueue
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
6920a6e8a5
commit
cecaab762d
@ -7,7 +7,7 @@ import net.minestom.server.network.PacketProcessor;
|
||||
import net.minestom.server.network.player.PlayerSocketConnection;
|
||||
import net.minestom.server.thread.MinestomThread;
|
||||
import net.minestom.server.utils.binary.BinaryBuffer;
|
||||
import org.jctools.queues.MpscUnboundedArrayQueue;
|
||||
import org.jctools.queues.MpscGrowableArrayQueue;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -31,7 +31,7 @@ public final class Worker extends MinestomThread {
|
||||
private final Map<SocketChannel, PlayerSocketConnection> connectionMap = new ConcurrentHashMap<>();
|
||||
private final Server server;
|
||||
private final PacketProcessor packetProcessor;
|
||||
private final MpscUnboundedArrayQueue<Runnable> queue = new MpscUnboundedArrayQueue<>(1024);
|
||||
private final MpscGrowableArrayQueue<Runnable> queue = new MpscGrowableArrayQueue<>(1024, Integer.MAX_VALUE / 2);
|
||||
private final AtomicBoolean flush = new AtomicBoolean();
|
||||
|
||||
public Worker(Server server, PacketProcessor packetProcessor) throws IOException {
|
||||
|
Loading…
Reference in New Issue
Block a user