add high and low priority event queues

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@674 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2006-02-26 00:12:17 +00:00
parent 5782ca928c
commit 7174e8ae8a
5 changed files with 113 additions and 79 deletions
+17
View File
@@ -85,6 +85,8 @@ struct switch_event_subclass {
struct switch_event {
/*! the event id (descriptor) */
switch_event_t event_id;
/*! the priority of the event */
switch_priority_t priority;
/*! the owner of the event */
char *owner;
/*! the subclass of the event */
@@ -139,6 +141,14 @@ SWITCH_DECLARE(switch_status) switch_event_shutdown(void);
*/
SWITCH_DECLARE(switch_status) switch_event_create_subclass(switch_event **event, switch_event_t event_id, char *subclass_name);
/*!
\brief Set the priority of an event
\param event the event to set the priority on
\param priority the event priority
\return SWITCH_STATUS_SUCCESS
*/
SWITCH_DECLARE(switch_status) switch_event_set_priority(switch_event *event, switch_priority_t priority);
/*!
\brief Retrieve a header value from an event
\param event the event to read the header from
@@ -253,6 +263,13 @@ SWITCH_DECLARE(switch_status) switch_event_add_body(switch_event *event, char *f
*/
#define switch_event_create(event, id) switch_event_create_subclass(event, id, SWITCH_EVENT_SUBCLASS_ANY)
/*!
\brief Deliver an event to all of the registered event listeners
\param event the event to send (will be nulled)
\note normaly use switch_event_fire for delivering events (only use this when you wish to deliver the event blocking on your thread)
*/
SWITCH_DECLARE(void) switch_event_deliver(switch_event **event);
/*!
\brief Fire an event filling in most of the arguements with obvious values
\param event the event to send (will be nulled on success)