The mqueue module offers a generic message queue system in shared memory for inter-process communication using the config file. One example of usage is to send time consuming operations to one or several timer processes that consumes items in the queue, without affecting SIP message handling in the socket-listening process. There can be many defined queues. Access to queued values is done via pseudo variables.
| Parámetro | Tipo | Descripción |
|---|---|---|
| db_url | str | 3.2. mqueue (string) 3.3. mqueue_name (string) 3.4. mqueue_size (int) 3.5. mqueue_addmode (int) |
| mqueue | string | 3.3. mqueue_name (string) 3.4. mqueue_size (int) 3.5. mqueue_addmode (int) |
| mqueue_name | string | 3.4. mqueue_size (int) 3.5. mqueue_addmode (int) |
| mqueue_size | int | 3.5. mqueue_addmode (int) |
| mqueue_addmode | int | 3.1. db_url (str) |
| db_url | str | The URL to connect to database for loading values in mqueue table at start up and/or saving values at shutdown. |
| mqueue | string | Definition of a memory queue |
| mqueue_name | string | Definition of a memory queue, just by name. |
| mqueue_size | int | Definition of the size of all memory queues defined via "mqueue_name" parameter. |
| mqueue_addmode | int | Sets the mode to be used when adding a new (key,value) pair in the mqueue. * 0 Add all new (key,value) at the end of mqueue * 1 Unique key, keep oldest (key,value) * 2 Unique key, keep newest(key,valu |
4.2. mq_fetch(queue) 4.3. mq_pv_free(queue) 4.4. mq_size(queue)
4.3. mq_pv_free(queue) 4.4. mq_size(queue)
4.4. mq_size(queue)
4.1. mq_add(queue, key, value)
Add a new item (key, value) in the queue. If max size of queue is exceeded, the oldest one is removed.
Take oldest item from queue and fill $mqk(queue) and $mqv(queue) pseudo variables.
Free the item fetched in pseudo-variables. It is optional, a new fetch frees the previous values.
Returns the current number of elements in the mqueue.
Copyright © 2010 Elena-Ramona Modroiu (asipto.com)
Copyright © 2018-2020 Julien chavanton, Flowroute