Search code examples
netty

Difference between `sync` and `await` in netty


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

Thank you


Solution

  • I feel like I disagree, the docs are not poorly written. They exists, but you need to read the API. However if you feel some docs 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 object using cause() method.

    See API:

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