When NetworkConnectionScheduler is closed:
- If there are more IO-threads than tasks in scheduler's work queue then the connection will finish its work.
- If there are more tasks than IO-threads then the connection processing can finish or an exception will be raised or the connection task will be abandoned in the work queue.
We would like to unify the handling of the connections when the NetworkConnectionScheduler is closed. The suggested solution is gracefully closed all connections registered in scheduler and finish all task in the work queue. The scheduler must not accept any new task when it is closed.