Class EventLoopGroupFactory
java.lang.Object
org.neo4j.bolt.connection.netty.impl.async.connection.EventLoopGroupFactory
Manages creation of Netty
EventLoopGroups, which are basically Executors that perform IO operations.-
Constructor Summary
ConstructorsConstructorDescriptionEventLoopGroupFactory(String threadNamePrefix, NettyTransport nettyTransport) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidAssert that current thread is not an event loop used for async IO operations.static booleanisEventLoopThread(Thread thread) Check if given thread is an event loop IO thread.io.netty.channel.EventLoopGroupnewEventLoopGroup(int threadCount)
-
Constructor Details
-
EventLoopGroupFactory
-
-
Method Details
-
nettyTransport
-
newEventLoopGroup
public io.netty.channel.EventLoopGroup newEventLoopGroup(int threadCount) -
assertNotInEventLoopThread
Assert that current thread is not an event loop used for async IO operations. This check is needed because blocking API methods are implemented on top of corresponding async API methods. Deadlocks might happen when IO thread executes blocking API call and has to wait for itself to read from the network.- Throws:
IllegalStateException- when current thread is an event loop IO thread.
-
isEventLoopThread
Check if given thread is an event loop IO thread.- Parameters:
thread- the thread to check.- Returns:
truewhen given thread belongs to the event loop,falseotherwise.
-