MatchKey is the identity used to decide whether an existing worker can serve a request. A nil profile shares the key of the zero/default profile, so legacy and default requests match the same workers.
()
| 41 | // request. A nil profile shares the key of the zero/default profile, so legacy |
| 42 | // and default requests match the same workers. |
| 43 | func (wp *WorkerProfile) MatchKey() string { |
| 44 | if wp == nil { |
| 45 | return "|" |
| 46 | } |
| 47 | return wp.CPU + "|" + wp.Memory |
| 48 | } |
| 49 | |
| 50 | // Equal reports whether two profiles match (nil == zero == default). |
| 51 | func (wp *WorkerProfile) Equal(other *WorkerProfile) bool { |
no outgoing calls