Back to index

php5  5.3.10
fpm_process_ctl.h
Go to the documentation of this file.
00001 
00002        /* $Id: fpm_process_ctl.h,v 1.6 2008/07/20 21:33:10 anight Exp $ */
00003        /* (c) 2007,2008 Andrei Nigmatulin */
00004 
00005 #ifndef FPM_PROCESS_CTL_H
00006 #define FPM_PROCESS_CTL_H 1
00007 
00008 #include "fpm_events.h"
00009 
00010 /* spawn max 32 children at once */
00011 #define FPM_MAX_SPAWN_RATE (32)
00012 /* 1s (in ms) heartbeat for idle server maintenance */
00013 #define FPM_IDLE_SERVER_MAINTENANCE_HEARTBEAT (1000)
00014 /* a minimum of 130ms heartbeat for pctl */
00015 #define FPM_PCTL_MIN_HEARTBEAT (130)
00016 
00017 
00018 struct fpm_child_s;
00019 
00020 void fpm_pctl(int new_state, int action);
00021 int fpm_pctl_can_spawn_children();
00022 int fpm_pctl_kill(pid_t pid, int how);
00023 void fpm_pctl_kill_all(int signo);
00024 void fpm_pctl_heartbeat(struct fpm_event_s *ev, short which, void *arg);
00025 void fpm_pctl_perform_idle_server_maintenance_heartbeat(struct fpm_event_s *ev, short which, void *arg);
00026 void fpm_pctl_on_socket_accept(struct fpm_event_s *ev, short which, void *arg);
00027 int fpm_pctl_child_exited();
00028 int fpm_pctl_init_main();
00029 
00030 
00031 enum {
00032        FPM_PCTL_STATE_UNSPECIFIED,
00033        FPM_PCTL_STATE_NORMAL,
00034        FPM_PCTL_STATE_RELOADING,
00035        FPM_PCTL_STATE_TERMINATING,
00036        FPM_PCTL_STATE_FINISHING
00037 };
00038 
00039 enum {
00040        FPM_PCTL_ACTION_SET,
00041        FPM_PCTL_ACTION_TIMEOUT,
00042        FPM_PCTL_ACTION_LAST_CHILD_EXITED
00043 };
00044 
00045 enum {
00046        FPM_PCTL_TERM,
00047        FPM_PCTL_STOP,
00048        FPM_PCTL_CONT,
00049        FPM_PCTL_QUIT
00050 };
00051 
00052 #endif
00053