You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Reference/routers.rst
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ The following network routers are currently supported:
10
10
- :ref:`network_router`
11
11
- :ref:`trans_mat`
12
12
- :ref:`pb_route`
13
+
- :ref:`pb_flex`
13
14
14
15
The following node routers are currently supported:
15
16
@@ -71,6 +72,28 @@ The :ref:`process based<process-based>` router takes in a function that returns
71
72
)
72
73
73
74
75
+
.. _pb_flex:
76
+
77
+
---------------------------------
78
+
The Flexible Process Based Routed
79
+
---------------------------------
80
+
81
+
The flexible process based router is an extension of the above process based router, where the routing function gives a list of sets (defined by lists). For example::
- The :code:`rule` argument can take one of two strings: :code:`'any'` or :code:`'all'`. For each set of nodes in the pre-defined route, using :code:`'any'` means that the customer must visit only one of the nodes in the set; while using :code:`'all'` means that the customer should visit all the nodes in that set, but not necessarily in that order.
91
+
- The :code:`choice` argument can take one of a number of strings. When using the :code:`'any'` rule, it determines how a node is chosen from the set. When using the :code:`'all'` rule, it determines at each instance, the choice of next node out of the set. The current options are:
92
+
- :code:`'random'`: randomly chooses a node from the set.
93
+
- :code:`'jsq'`: chooses the node with the smallest queue from the set (like the :ref:`join-shortest-queue<jsq>` router).
94
+
- :code:`'lb'`: chooses the node with the least number of customers present from the set (like the :ref:`load-balancing<load_balancing>` router).
95
+
96
+
74
97
75
98
76
99
Node Routing Objects
@@ -125,6 +148,7 @@ The customer goes :ref:`joins the shortest queue<join-shortest-queue>` out of a
125
148
126
149
The :code:`tie_break` argument is optional, and can take one of two strings: :code:`'random'` or :code:`'order'`. When there is a tie between the nodes with the shortest queue, tie breaks are either dealt with by choosing randomly between the ties (:code:`'random'`), or take precedence by the order listed in the :code:`destinations` list (:code:`'order'`). If omitted, random tie-breaking is used.
0 commit comments