]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_fifo: Document effect of fifo strategy and importance
authorTravis Cross <tc@traviscross.com>
Tue, 27 May 2014 04:15:44 +0000 (04:15 +0000)
committerTravis Cross <tc@traviscross.com>
Wed, 28 May 2014 01:32:10 +0000 (01:32 +0000)
src/mod/applications/mod_fifo/mod_fifo.c

index 5671ad57548feffb0b7e8655b81b344ab5812a69..7d0151f4287b33fab68452a28fa2d47bcbf48fe2 100644 (file)
@@ -2983,6 +2983,33 @@ SWITCH_STANDARD_APP(fifo_function)
                                }
                        }
 
+                       /* Before we can pick a caller we have to decide on a fifo
+                          node to service if the consumer can service more than
+                          one.
+
+                          If all fifos have an importance of zero, we'll find the
+                          first node that wins based on the chosen strategy.
+
+                          The `waiting_longer` strategy will choose the node that
+                          hasn't been empty for the longest time.
+
+                          The `more_ppl` strategy will choose the node that has
+                          the most people waiting.
+
+                          If a node has an importance value set, it will cause us
+                          to ignore later nodes with equivalent or lower
+                          importance values.  This means that a node with the
+                          same importance that would otherwise win based on the
+                          strategy will not be considered at all if it comes
+                          later in the list.  Note also that the high importance
+                          node may still lose if a considered fifo earlier in the
+                          list beats it per the strategy.
+
+                          Note that when the consumer has been delivered by an
+                          outbound strategy there will only be one fifo node
+                          passed to us, so neither the importance nor the
+                          strategy here will have any effect.
+                       */
                        for (i = 0; i < node_count; i++) {
                                if (!(node = node_list[i])) {
                                        continue;