Details

Description

This is a patch to app_queue.c that enables dynamic realtime for queues.
Queue parameters and member list for a queue are loaded from realtime
each time the Queue application command is called, so that updates are
available immediately without the need for an explicit reload.

Disclaimer has been faxed on April 15, 2005. The disclaimer concerns
Sifira A/S, which is the company that employs me and owns the copyright
for the code.

ADDITIONAL INFORMATION ******

To enable the use of dynamic realtime for queues, first create the table
in the database. For MySQL:

If a queue name is defined statically in queues.conf, it will not be
looked up in dynamic realtime.

After this, queues can be defined / modified in the queues_table and be
immediately available without reload. Queues are defined in the table
with the same parameters used in the config file. The `category' column
is the queue name, the `var_name' column is the parameter name, and the
`var_val' column is the parameter value. For example:

This database setup is chosen to resemble closely the one used in static
realtime, so you should be able to use the same rows for static and
dynamic realtime. For now I have chosen this for simplicity; another
attractive and just-as-easy-to-implement possibility would be to have
two tables: One `queue' table with one row per queue and one column for
each parameter; and one `queue_member' table with one row per member and
columns for member interface and penalty. The latter model is perhaps
prettyer from a relatinal database perspective.

Other than that I will add documentation to the Wiki (or another
appropriate place if/when this is accepted into CVS.

Brian West
added a comment - 16/Apr/05 11:58 AM This is actually done kinda wrong. Shouldn't the column name match the var.. and the contents of the column be the value? This is pretty much automagic right?
/b

I think we should finish this issue one way or the other, add to CVS or not, but let's finish it.

I looked once more into the AddQueueMember stuff, and I still think the only sane way is to map them to realtime INSERT/DELETE, once that is added to realtime. The comment from outtolunc seems to agree.

Or perhaps use drmac's realtime UPDATE proposal, but that also requires realtime additions: the current realtime API does not allow to update on a composite key, and realtime queue need the key (queue, member).

Both twilson and MikeJ seemed to think this should be added to CVS and the dynamic stuff moved to another bug.

Or if you prefer, I will just have to maintain this locally for our own purpose.

knielsen
added a comment - 31/May/05 3:41 AM I think we should finish this issue one way or the other, add to CVS or not, but let's finish it.
I looked once more into the AddQueueMember stuff, and I still think the only sane way is to map them to realtime INSERT/DELETE, once that is added to realtime. The comment from outtolunc seems to agree.
Or perhaps use drmac's realtime UPDATE proposal, but that also requires realtime additions: the current realtime API does not allow to update on a composite key, and realtime queue need the key (queue, member).
Both twilson and MikeJ seemed to think this should be added to CVS and the dynamic stuff moved to another bug.
Or if you prefer, I will just have to maintain this locally for our own purpose.