mstar.engine.resources.admission#

Admission across the resources of one runner, see Resource.ask.

Classes

Admission(resources, ask_order)

The queues of the resources that ask, and the nodes each request was admitted on.

class mstar.engine.resources.admission.Admission(resources, ask_order)[source]#

Bases: object

The queues of the resources that ask, and the nodes each request was admitted on.

A waiting request is admitted once it is first in every queue it is in and each resource it asked reserves for it, all or nothing.

Parameters:
admit(rid, node_name, graph_walk, published, keys)[source]#

None once rid is admitted on node_name, else why it waits or fails. keys are the resources of node_name that ask.

Parameters:
Return type:

FullAdmitOutcome | None

admit_waiting(published_of)[source]#

Admit each waiting request that is now first in every queue it is in and fits, and return the (node, rid) pairs that may start. published_of(rid, node) gives what the request published for that node’s resources.

Nothing is tried until a resource whose first waiting request didn’t fit has grown, or a queue has a new first request, so a pass that changed neither costs one Resource.grew_since for each such resource.

Parameters:

published_of (Callable[[str, str], Mapping[str, PublishedInfo] | None])

Return type:

list[tuple[str, str]]

admitted(rid, node_name)[source]#
Parameters:
Return type:

bool

remove_request(rid)[source]#
Parameters:

rid (str)

Return type:

None