diff options
| author | David Sommerseth <davids@redhat.com> | 2009-10-21 10:31:56 +0200 |
|---|---|---|
| committer | David Sommerseth <davids@redhat.com> | 2009-10-21 10:31:56 +0200 |
| commit | 143167cc63b7c809abcb048ec4454d8c5cebcb42 (patch) | |
| tree | c7252293fbaaa4349f76f7ddf1ea8afd610b3312 /server/parser/pgsql.h | |
| parent | 6e90b1e99b02a9cac45686c63ddeeae044466aca (diff) | |
| download | rteval-143167cc63b7c809abcb048ec4454d8c5cebcb42.tar.gz rteval-143167cc63b7c809abcb048ec4454d8c5cebcb42.tar.xz rteval-143167cc63b7c809abcb048ec4454d8c5cebcb42.zip | |
Implemented database LISTEN via db_wait_notification()
This introduces async waiting for report parsing. Commit
2584a3c36c97c757dc80108b898eede52b91dc44 introduced sending
a NOTIFY whenever an INSERT is done into the submissionqueue table.
With the db_wait_notification() the process_submission_queue() function
will sleep until a a notification is received.
The LISTEN, UNLISTEN and NOTIFY SQL commands are PostgreSQL dependent.
Other database implementations may use what that database supports, or
just simply do a sleep() to change the behaviour to a polling model.
Diffstat (limited to 'server/parser/pgsql.h')
| -rw-r--r-- | server/parser/pgsql.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/server/parser/pgsql.h b/server/parser/pgsql.h index d4ea2c9..4238e5b 100644 --- a/server/parser/pgsql.h +++ b/server/parser/pgsql.h @@ -48,6 +48,7 @@ int db_commit(dbconn *dbc); int db_rollback(dbconn *dbc); /* rteval specific database functions */ +int db_wait_notification(dbconn *dbc, const int *shutdown, const char *listenfor); parseJob_t *db_get_submissionqueue_job(dbconn *dbc, pthread_mutex_t *mtx); int db_update_submissionqueue(dbconn *dbc, unsigned int submid, int status); int db_register_system(dbconn *dbc, xsltStylesheet *xslt, xmlDoc *summaryxml); |
