zan-extension/src/reactor/ReactorBase.c
/**
 * execute when reactor timeout and reactor finish
 */
execute when reactor timeout and reactor finish
execute when reactor timeout and reactor finish
static void swReactor_onTimeout_and_Finish(swReactor *reactor)
{
    if (reactor->check_timer)
    {
        swTimer_select(&ServerG.timer);
    }
    zan_update_time();
    handle_defer_call(reactor);
    if (is_worker() || is_networker()) {
        zanWorker *worker = zanServer_get_worker(ServerG.serv, ServerWG.worker_id);
        if (worker != NULL && ServerWG.reload)
        {
            ServerWG.reload_count++;
            if (reactor->event_num <= 2 || ServerWG.reload_count >= SW_MAX_RELOAD_WAIT)
            {
                reactor->running = 0;
            }
        }
    }
    if (ServerG.serv == NULL && ServerG.timer.num <= 0 && !reactor->defer_callback_list)
    {
        if (ZanAIO.init && reactor->event_num == 1 && ZanAIO.task_num == 0)
        {
            reactor->running = 0;
        }
        else if (reactor->event_num == 0)
        {
            reactor->running = 0;
        }
    }
}
static void swReactor_onTimeout_and_Finish ( swReactor * reactor ) { if ( reactor -> check_timer ) { swTimer_select ( & ServerG . timer ) ; } zan_update_time ( ) ; handle_defer_call ( reactor ) ; if ( is_worker ( ) || is_networker ( ) ) { zanWorker * worker = zanServer_get_worker ( ServerG . serv , ServerWG . worker_id ) ; if ( worker != NULL && ServerWG . reload ) { ServerWG . reload_count ++ ; if ( reactor -> event_num <= 2 || ServerWG . reload_count >= SW_MAX_RELOAD_WAIT ) { reactor -> running = 0 ; } } } if ( ServerG . serv == NULL && ServerG . timer . num <= 0 && ! reactor -> defer_callback_list ) { if ( ZanAIO . init && reactor -> event_num == 1 && ZanAIO . task_num == 0 ) { reactor -> running = 0 ; } else if ( reactor -> event_num == 0 ) { reactor -> running = 0 ; } } }
execute when reactor timeout and reactor finish
execute when reactor timeout and reactor finish
//check timer //defer callback //server worker  //TODO: //client