The most common , For example, in business development , The service is suddenly abnormal , The user request that just came in is still , By closing gracefully , Give them 30s Time goes on , So as not to report mistakes directly .
- modify NioEventLoop Of State Sign a
- NioEventLoop Judge State Execute exit
Don't pick it up first , Then try to finish the work at hand （ First off boss Houguan worker： Not a 100% guarantee ）
Breaking point , It mainly depends on workGroup The closing of the
- Two times are introduced here
- One for elegance
- One for control
Change from start state to stop state
And then in NioEventLoop To judge the closing position of the break point
- Carry out the unfinished task , No, it's over .
Close all connections and Selector
- java.nio.channels. SelectionKey#cancel
Close all threads ： Exit the circulatory body
本文为[The official account -JavaEdge]所创，转载请带上原文链接，感谢