Thomas Geulen
Thomas Geulen

Reputation: 201

Netty 4.0 - instanciate DefaultChannelGroup

I am currently migrating my project from Netty 3.x to 4.0.4 Final and i have a little question about ChannelGroups.

DefaultChannelGroup needs now an EventExecutor in the constructor. Unfortunately i didn´t really understand the thread model of Netty 4.0 yet.

How can i instanciate an EventExecutor for my ChannelGroups? I just want the write operations beeing executed in several threads.

ChannelGroup newChannelGroup = 
new DefaultChannelGroup(name, new DefaultEventExecutorGroup(1).next());

Is this the right way?

Upvotes: 2

Views: 2836

Answers (1)

Matthew Phillips
Matthew Phillips

Reputation: 1284

The code that's used in the examples is:

ChannelGroup channelGroup = 
  new DefaultChannelGroup (name, GlobalEventExecutor.INSTANCE);

Upvotes: 4

Related Questions