在Netty使用ChannelFuture和ChannelPromise进行异步操作的处理
这是官方给出的ChannelFutur描述
1 * | Completed successfully | 2 * +---------------------------+ 3 * +----> isDone() = true | 4 * +--------------------------+ | | isSuccess() = true | 5 * | Uncompleted | | +===========================+ 6 * +--------------------------+ | | Completed with failure | 7 * | isDone() = false | | +---------------------------+ 8 * | isSuccess() = false |----+----> isDone() = true | 9 * | isCancelled() = false | | | cause() = non-null | 10 * | cause() = null | | +===========================+ 11 * +--------------------------+ | | Completed by cancellation | 12 * | +---------------------------+ 13 * +----> isDone() = true | 14 * | isCancelled() = true | 15 * +---------------------------+