class documentation
The write side of a Subscription; every method runs on the Runtime's event loop.
| Method | __init__ |
Open a sink buffering at most depth messages, affine to the running loop. |
| Async Method | await |
Await more incompatibilities than have been seen, and return how many there now are. |
| Async Method | await |
Await a publisher count other than one already seen, and return it. |
| Method | close |
End the stream, waking every consumer waiting on it. |
| Method | deliver |
Accept one decoded message, dropping the oldest buffered one if the buffer is full. |
| Method | note |
Record one incompatibility the middleware reported, unless it is one already recorded. |
| Method | note |
Accept the publisher count a match event reported (a missed event costs nothing). |
| Method | note |
Record the profile this subscription asks for, after a re-subscription made it true. |
| Method | note |
Record a type-hash disagreement seen on this topic. |
| Method | require |
Refuse an operation running on a loop other than the one this sink was opened on. |
| Async Method | take |
Await the next buffered message. |
| Property | closed |
Return whether the subscription's lifetime has ended. |
| Property | publisher |
Return how many publishers this subscription is currently matched with. |
| Property | qos |
Return the QoS profile the subscription is currently asking for. |
| Property | qos |
Return every incompatibility the middleware has reported on this topic so far. |
| Property | qos |
Return where that profile came from, and therefore whether it may adapt. |
| Property | type |
Return every type-hash disagreement seen on this topic so far. |
| Instance Variable | _arrival |
Undocumented |
| Instance Variable | _closed |
Undocumented |
| Instance Variable | _incompatibilities |
Undocumented |
| Instance Variable | _incompatible |
Undocumented |
| Instance Variable | _loop |
Undocumented |
| Instance Variable | _matched |
Undocumented |
| Instance Variable | _messages |
Undocumented |
| Instance Variable | _mismatches |
Undocumented |
| Instance Variable | _provenance |
Undocumented |
| Instance Variable | _publishers |
Undocumented |
| Instance Variable | _qos |
Undocumented |
def __init__(self, *, depth:
int, qos: QoSProfile = MOST_PERMISSIVE, provenance: Provenance = Provenance.DISCOVERED):
¶
Open a sink buffering at most depth messages, affine to the running loop.
| Parameters | |
depth:int | How many messages may wait for a consumer. When the buffer is full the oldest is dropped, since a Monitoring variable wants the newest value. |
qos:QoSProfile | The profile the subscription opened with. |
provenance:Provenance | Where that profile came from. |
| Raises | |
RuntimeError | When constructed with no running event loop. |
ValueError | When depth is below 1. |
Await more incompatibilities than have been seen, and return how many there now are.
| Raises | |
SubscriptionClosedError | When the subscription closes while waiting. |
LoopAffinityError | When awaited on a loop other than this sink's. |
Await a publisher count other than one already seen, and return it.
| Raises | |
SubscriptionClosedError | When the subscription closes while waiting. |
LoopAffinityError | When awaited on a loop other than this sink's. |
Record one incompatibility the middleware reported, unless it is one already recorded.
Deduplicated by policy and request, so a flapping publisher cannot produce an unbounded list or an event storm. A clash after an adaptation counts as new, since the request moved.
| Returns | |
bool | Whether this was new. The caller logs only then. |
Refuse an operation running on a loop other than the one this sink was opened on.
| Raises | |
LoopAffinityError | When the running loop is not this sink's. |
Await the next buffered message.
| Raises | |
SubscriptionClosedError | When the subscription is closed and the buffer is empty. |
LoopAffinityError | When awaited on a loop other than this sink's. |