Skip to content

Strategies don't allow preferring certain submissions over others except for their age #95

@ReinierMaas

Description

@ReinierMaas

#[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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions