提交 830755ac authored 作者: Anthony Minessale's avatar Anthony Minessale

allow event consumer to supply size as optional arg

上级 b472edf4
...@@ -186,7 +186,7 @@ SWITCH_DECLARE(bool) email(char *to, char *from, char *headers = NULL, char *bod ...@@ -186,7 +186,7 @@ SWITCH_DECLARE(bool) email(char *to, char *from, char *headers = NULL, char *bod
switch_event_node_t *enodes[SWITCH_EVENT_ALL + 1]; switch_event_node_t *enodes[SWITCH_EVENT_ALL + 1];
uint32_t node_index; uint32_t node_index;
SWITCH_DECLARE_CONSTRUCTOR EventConsumer(const char *event_name = NULL, const char *subclass_name = ""); SWITCH_DECLARE_CONSTRUCTOR EventConsumer(const char *event_name = NULL, const char *subclass_name = "", int len = 5000);
SWITCH_DECLARE_CONSTRUCTOR ~ EventConsumer(); SWITCH_DECLARE_CONSTRUCTOR ~ EventConsumer();
SWITCH_DECLARE(int) bind(const char *event_name, const char *subclass_name = ""); SWITCH_DECLARE(int) bind(const char *event_name, const char *subclass_name = "");
SWITCH_DECLARE(Event *) pop(int block = 0, int timeout = 0); SWITCH_DECLARE(Event *) pop(int block = 0, int timeout = 0);
......
...@@ -50,11 +50,11 @@ static void event_handler(switch_event_t *event) ...@@ -50,11 +50,11 @@ static void event_handler(switch_event_t *event)
} }
SWITCH_DECLARE_CONSTRUCTOR EventConsumer::EventConsumer(const char *event_name, const char *subclass_name) SWITCH_DECLARE_CONSTRUCTOR EventConsumer::EventConsumer(const char *event_name, const char *subclass_name, int len)
{ {
switch_core_new_memory_pool(&pool); switch_core_new_memory_pool(&pool);
switch_queue_create(&events, 5000, pool); switch_queue_create(&events, len, pool);
node_index = 0; node_index = 0;
if (!zstr(event_name)) { if (!zstr(event_name)) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论