class documentation

class QoSNegotiation:

Constructor: QoSNegotiation(declared, endpoints)

View In Hierarchy

One endpoint's provenance, its current profile, and the two events that may move it.

The adaptation rule as a pure state machine: the Runtime re-subscribes when an event method returns a new profile, and gets None when nothing moved.

Method __init__ Settle the provenance and the opening profile from what was declared and what publishes.
Method __repr__ Return a representation naming the provenance and the profile.
Method incompatibility Answer one incompatibility the middleware reported, as the record of what happened.
Method on_first_publisher Re-resolve once, against the first publishers this endpoint ever matched.
Method on_incompatibility Relax towards what the graph now offers, if and only if this profile was discovered.
Property profile Return the profile this endpoint is asking for right now.
Property provenance Return where that profile came from, which decides whether it may move.
Method _moved_to Take a newly resolved profile, answering None when it is the one already held.
Instance Variable _bootstrapped Undocumented
Instance Variable _declared Undocumented
Instance Variable _profile Undocumented
Instance Variable _provenance Undocumented
def __init__(self, *, declared: QoSProfile | None, endpoints: Sequence[EndpointInfo] = ()):

Settle the provenance and the opening profile from what was declared and what publishes.

Parameters
declared:QoSProfile | NoneThe profile written on the declaration, or None to discover one.
endpoints:Sequence[EndpointInfo]Every publisher on the topic right now. Ignored when a profile was declared, even if it is provably incompatible with what is publishing.
def __repr__(self) -> str:

Return a representation naming the provenance and the profile.

def incompatibility(self, topic: str, policy: Policy, endpoints: Sequence[EndpointInfo]) -> QoSIncompatibility:

Answer one incompatibility the middleware reported, as the record of what happened.

This is on_incompatibility plus the record, so the Runtime and test doubles share one code path.

Returns
QoSIncompatibilityWhat clashed, what was being asked for, and what this moved to, if anything.
def on_first_publisher(self, endpoints: Sequence[EndpointInfo]) -> QoSProfile | None:

Re-resolve once, against the first publishers this endpoint ever matched.

The only tightening in the rule, at most once: a discovered Binding whose topic was empty at init asks for MOST_PERMISSIVE, which would miss a latched publisher's history.

Parameters
endpoints:Sequence[EndpointInfo]Every publisher on the topic now. An empty list does not spend the bootstrap.
Returns
QoSProfile | NoneThe profile to re-subscribe with, or None when nothing moved.
def on_incompatibility(self, endpoints: Sequence[EndpointInfo]) -> QoSProfile | None:

Relax towards what the graph now offers, if and only if this profile was discovered.

The result is the most permissive of what is held and what the current publishers resolve to, so a departed publisher never tightens the subscription. It also spends the bootstrap, since a later first-match tightening would undo this.

Parameters
endpoints:Sequence[EndpointInfo]Every publisher on the topic now. Empty relaxes the whole way.
Returns
QoSProfile | NoneThe profile to re-subscribe with, or None when nothing moved, which includes every declared and defaulted profile.
@property
profile: QoSProfile =

Return the profile this endpoint is asking for right now.

@property
provenance: Provenance =

Return where that profile came from, which decides whether it may move.

def _moved_to(self, profile: QoSProfile) -> QoSProfile | None:

Take a newly resolved profile, answering None when it is the one already held.

_bootstrapped: bool =

Undocumented

_declared =

Undocumented

_profile =

Undocumented

_provenance =

Undocumented