|
#[pyclass(frozen, eq, module = "opsqueue_internal")] |
|
pub enum Strategy { |
|
#[pyo3(constructor=())] |
|
Oldest(), |
|
#[pyo3(constructor=())] |
|
Newest(), |
|
#[pyo3(constructor=())] |
|
Random(), |
|
#[pyo3(constructor=(*, meta_key, underlying))] |
|
PreferDistinct { |
|
meta_key: String, |
|
underlying: Py<Strategy>, |
|
}, |
|
} |
Highest(meta_key)/Lowest(meta_key): Would make sense as this allows eating from one side of the key space
- We already have
Oldest/Newest: effectively Highest/Lowest with submission_time as meta_key
- Priority based scheduling could be implemented using these strategies
- Underlying strategies could be used to move the needle further
- For high priority submissions you would prefer newest if latency is important
- For low priority submission you could prefer oldest, i.e. preferring finishing submitted work
opsqueue/libs/opsqueue_python/src/common.rs
Lines 102 to 115 in 78f1cc1
Highest(meta_key)/Lowest(meta_key): Would make sense as this allows eating from one side of the key spaceOldest/Newest: effectivelyHighest/Lowestwithsubmission_timeasmeta_key