#3781: Fix eventLoopCallback
This commit is contained in:
parent
dd2033bf1a
commit
ed4a80eb0b
@ -899,19 +899,25 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
|||||||
// otherwise netty will schedule any pipeline related call by itself, this decreases performance
|
// otherwise netty will schedule any pipeline related call by itself, this decreases performance
|
||||||
private <T> Callback<T> eventLoopCallback(Callback<T> callback)
|
private <T> Callback<T> eventLoopCallback(Callback<T> callback)
|
||||||
{
|
{
|
||||||
EventLoop eventLoop = ch.getHandle().eventLoop();
|
return (result, error) ->
|
||||||
return eventLoop.inEventLoop() ? (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( () ->
|
|
||||||
{
|
eventLoop.execute( () ->
|
||||||
if ( !ch.isClosing() )
|
|
||||||
{
|
{
|
||||||
callback.done( result, error );
|
if ( !ch.isClosing() )
|
||||||
}
|
{
|
||||||
} );
|
callback.done( result, error );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user