vert-x3 / vertx-mongo-client

Mongo Client for Eclipse Vert.x
http://vertx.io
Apache License 2.0
60 stars 98 forks source link

Make use of internal Vert.x EventLoopGroup #60

Open meshuga opened 8 years ago

meshuga commented 8 years ago

Mongo client can make use of Netty event loop group for async request processing, so it might be possible to pass a vert.x group instance using io.vertx.core.Vertx#nettyEventLoopGroup() to https://github.com/mongodb/mongo-java-driver/blob/master/driver-async/src/main/com/mongodb/async/client/MongoClientSettings.java#L272 like below:


builder.streamFactoryFactory(
  new NettyStreamFactoryFactory(vertx.nettyEventLoopGroup(), ByteBufAllocator.DEFAULT))
  .build();

According to http://normanmaurer.me/presentations/2014-facebook-eng-netty/slides.html#25.0 it's a good idea :wink:

karianna commented 8 years ago

@johnoliver going to have to defer to your wisdom here. Good idea or no?

llfbandit commented 8 years ago

Seems a good idea to me (with all my noobishness knowledge in vertx :8ball: ), the job has been already done in other sections by the way to be more concrete. This commit is a partial view of some of the places where we can find the attachement to the netty looper : https://github.com/eclipse/vert.x/pull/1158/commits/a595010b0204a5e6a1bdb892c0b09ba8bd6e1fa7