Skip to content

Commit

Permalink
Merge pull request #11 from SpigotMC/master
Browse files Browse the repository at this point in the history
[pull] master from SpigotMC:master
  • Loading branch information
pull[bot] authored Feb 8, 2025
2 parents 0f2a4fa + ed4a80e commit c54b386
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -899,19 +899,25 @@ public CompletableFuture<byte[]> sendData(String channel, byte[] data)
// otherwise netty will schedule any pipeline related call by itself, this decreases performance
private <T> Callback<T> eventLoopCallback(Callback<T> callback)
{
EventLoop eventLoop = ch.getHandle().eventLoop();
return eventLoop.inEventLoop() ? (result, error) ->
return (result, error) ->
{
if ( !ch.isClosing() )
EventLoop eventLoop = ch.getHandle().eventLoop();
if ( eventLoop.inEventLoop() )
{
callback.done( result, error );
if ( !ch.isClosing() )
{
callback.done( result, error );
}
return;
}
} : (result, error) -> eventLoop.execute( () ->
{
if ( !ch.isClosing() )

eventLoop.execute( () ->
{
callback.done( result, error );
}
} );
if ( !ch.isClosing() )
{
callback.done( result, error );
}
} );
};
}
}

0 comments on commit c54b386

Please sign in to comment.