summaryrefslogtreecommitdiffstats
path: root/action.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-05-07 10:44:46 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-05-07 10:44:46 +0200
commit68877497a131d5b7c5b1588b771a623fc0ad41c1 (patch)
tree75f2267c053ff9bed596d6b46787045cf212f0ed /action.h
parentbbb0d7c9d1b63dfd78f0ab33fd014909b20bf785 (diff)
downloadrsyslog-68877497a131d5b7c5b1588b771a623fc0ad41c1.tar.gz
rsyslog-68877497a131d5b7c5b1588b771a623fc0ad41c1.tar.xz
rsyslog-68877497a131d5b7c5b1588b771a623fc0ad41c1.zip
first shot at action state machine implemention (untested)
I am commiting it so that the code is visible, but will no begin with the test environment.
Diffstat (limited to 'action.h')
-rw-r--r--action.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/action.h b/action.h
index f2706af6..69d6713c 100644
--- a/action.h
+++ b/action.h
@@ -36,6 +36,15 @@
extern int glbliActionResumeRetryCount;
+typedef enum {
+ ACT_STATE_DIED = 0, /* action permanently failed and now disabled - MUST BE ZEO! */
+ ACT_STATE_RDY = 1, /* action ready, waiting for new transaction */
+ ACT_STATE_ITX = 2, /* transaction active, waiting for new data or commit */
+ ACT_STATE_COMM = 3, /* transaction finished (a transient state) */
+ ACT_STATE_RTRY = 4, /* failure occured, trying to restablish ready state */
+ ACT_STATE_SUSP = 5 /* suspended due to failure (return fail until timeout expired) */
+} action_state_t;
+
/* the following struct defines the action object data structure
*/
struct action_s {
@@ -45,8 +54,10 @@ struct action_s {
time_t tLastExec; /* time this action was last executed */
int bExecWhenPrevSusp;/* execute only when previous action is suspended? */
int iSecsExecOnceInterval; /* if non-zero, minimum seconds to wait until action is executed again */
- short bEnabled; /* is the related action enabled (1) or disabled (0)? */
- short bSuspended; /* is the related action temporarily suspended? */
+ action_state_t eState; /* current state of action */
+ int bHadAutoCommit; /* did an auto-commit happen during doAction()? */
+ //short bEnabled; /* is the related action enabled (1) or disabled (0)? */
+ //short bSuspended; /* is the related action temporarily suspended? */
time_t ttResumeRtry; /* when is it time to retry the resume? */
int iResumeInterval;/* resume interval for this action */
int iResumeRetryCount;/* how often shall we retry a suspended action? (-1 --> eternal) */