@@ -42,6 +42,11 @@ type flowItem struct {
42
42
// effectiveTTL is the actual Time-To-Live assigned to this item by the FlowController, considering the request's
43
43
// preference and controller defaults.
44
44
effectiveTTL time.Duration
45
+ // priorityScore represents the dispatch priority of this item. The score's meaning and calculation method are
46
+ // determined by the IntraFlowDispatchPolicy governing this item's queue, and its type is indicated by
47
+ // QueueStateReader.PriorityScoreType() of the queue.
48
+ // Convention: For many scores, a lower numerical value might indicate higher priority.
49
+ priorityScore float64
45
50
// queueHandle is the opaque handle returned by the FlowQueue when this item is successfully added to a queue.
46
51
// It's used by the FlowController to instruct the FlowQueue to remove this specific item.
47
52
// This is nil until the item is successfully enqueued into a FlowQueue.
@@ -83,6 +88,8 @@ func newFlowItem(req types.FlowControlRequest, spec types.FlowSpecification, eff
83
88
84
89
// --- Implementation of types.QueueItemAccessor ---
85
90
91
+ var _ types.QueueItemAccessor = & flowItem {} // Compile-time validation
92
+
86
93
func (fi * flowItem ) EnqueueTime () time.Time {
87
94
return fi .enqueueTime
88
95
}
@@ -107,6 +114,18 @@ func (fi *flowItem) OriginalRequest() types.FlowControlRequest {
107
114
return fi .originalRequest
108
115
}
109
116
117
+ func (fi * flowItem ) PriorityScore () float64 {
118
+ return fi .priorityScore
119
+ }
120
+
121
+ func (fi * flowItem ) Handle () types.QueueItemHandle {
122
+ return fi .queueHandle
123
+ }
124
+
125
+ func (fi * flowItem ) SetHandle (handle types.QueueItemHandle ) {
126
+ fi .queueHandle = handle
127
+ }
128
+
110
129
// --- Lifecycle Management Methods (called by FlowController) ---
111
130
112
131
// setQueueDetails is called by the FlowController *after* an item has been
0 commit comments