Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between `sync` and `await` in netty

Tags:

netty

What is the difference between the sync and await methods on netty? Both block the current thread?

Thank you

like image 380
simao Avatar asked Nov 24 '14 08:11

simao


1 Answers

I feel like I disagree, the docs are not poorly written. They exists, but you nee to read the API. However if you feel some doc are missing, Netty loves contributions ;-)

So for your question: The difference is indeed sync() will rethrow the failure if this future failed, while await() will not (and if you need the exception, you need to ask for it to the future objet using cause() method.

See API:

http://netty.io/4.1/api/io/netty/channel/ChannelFuture.html#sync()

like image 86
Frederic Brégier Avatar answered Oct 18 '22 03:10

Frederic Brégier