findInBucket returns the call state in the bucket matching the same node id and call identity, or nil if no match is present.
(bucket []*asyncCallState, id int64, function, overload string, args []ref.Val)
| 205 | // findInBucket returns the call state in the bucket matching the same node id and call identity, |
| 206 | // or nil if no match is present. |
| 207 | func findInBucket(bucket []*asyncCallState, id int64, function, overload string, args []ref.Val) *asyncCallState { |
| 208 | for _, acs := range bucket { |
| 209 | if acs.matches(id, function, overload, args) { |
| 210 | return acs |
| 211 | } |
| 212 | } |
| 213 | return nil |
| 214 | } |
| 215 | |
| 216 | // getOrCreate returns the existing call state for the (node id, args) tuple, or registers and |
| 217 | // returns a new one. A newly registered call is assigned a unique callID and counted as pending. |