Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-06 00:00:47 +01:00
Small cleanup
Dieser Commit ist enthalten in:
Ursprung
ae12c478ca
Commit
8971dbe3c3
@ -73,7 +73,6 @@ public enum TransportType {
|
|||||||
final ChannelFactory<? extends SocketChannel> socketChannelFactory;
|
final ChannelFactory<? extends SocketChannel> socketChannelFactory;
|
||||||
final ChannelFactory<? extends DatagramChannel> datagramChannelFactory;
|
final ChannelFactory<? extends DatagramChannel> datagramChannelFactory;
|
||||||
final Supplier<IoHandlerFactory> ioHandlerFactorySupplier;
|
final Supplier<IoHandlerFactory> ioHandlerFactorySupplier;
|
||||||
volatile IoHandlerFactory ioHandlerFactory;
|
|
||||||
|
|
||||||
TransportType(final String name,
|
TransportType(final String name,
|
||||||
final ChannelFactory<? extends ServerSocketChannel> serverSocketChannelFactory,
|
final ChannelFactory<? extends ServerSocketChannel> serverSocketChannelFactory,
|
||||||
@ -99,12 +98,8 @@ public enum TransportType {
|
|||||||
* @return the event loop group
|
* @return the event loop group
|
||||||
*/
|
*/
|
||||||
public EventLoopGroup createEventLoopGroup(final Type type) {
|
public EventLoopGroup createEventLoopGroup(final Type type) {
|
||||||
if (this.ioHandlerFactory == null) {
|
|
||||||
this.ioHandlerFactory = this.ioHandlerFactorySupplier.get();
|
|
||||||
}
|
|
||||||
assert this.ioHandlerFactory != null;
|
|
||||||
return new MultiThreadIoEventLoopGroup(
|
return new MultiThreadIoEventLoopGroup(
|
||||||
0, createThreadFactory(this.name, type), this.ioHandlerFactory);
|
0, createThreadFactory(this.name, type), this.ioHandlerFactorySupplier.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ThreadFactory createThreadFactory(final String name, final Type type) {
|
private static ThreadFactory createThreadFactory(final String name, final Type type) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren