|
54 | 54 | pn_terminus_is_dynamic, pn_terminus_outcomes, pn_terminus_properties, pn_terminus_set_address, \
|
55 | 55 | pn_terminus_set_distribution_mode, pn_terminus_set_durability, pn_terminus_set_dynamic, \
|
56 | 56 | pn_terminus_set_expiry_policy, pn_terminus_set_timeout, pn_terminus_set_type, \
|
57 |
| - pn_link_properties, pn_link_remote_properties |
| 57 | + pn_link_properties, pn_link_remote_properties, pn_unsettled_head |
58 | 58 |
|
59 | 59 | from ._condition import cond2obj, obj2cond
|
60 | 60 | from ._data import Data, dat2obj, obj2dat, PropertyDict, SymbolList
|
|
63 | 63 | from ._handler import Handler
|
64 | 64 | from ._transport import Transport
|
65 | 65 | from ._wrapper import Wrapper
|
66 |
| -from typing import Any, Dict, List, Optional, Union, TYPE_CHECKING |
| 66 | +from typing import Any, Dict, Generator, List, Optional, Union, TYPE_CHECKING |
67 | 67 |
|
68 | 68 | if TYPE_CHECKING:
|
69 | 69 | from ._condition import Condition
|
@@ -888,6 +888,28 @@ def unsettled(self) -> int:
|
888 | 888 | """
|
889 | 889 | return pn_link_unsettled(self._impl)
|
890 | 890 |
|
| 891 | + @property |
| 892 | + def unsettled_head(self) -> Optional[Delivery]: |
| 893 | + """ |
| 894 | + The first unsettled delivery for this link. |
| 895 | +
|
| 896 | + This operation will return the first unsettled delivery on the |
| 897 | + link, or ``None`` if there are no unsettled deliveries. |
| 898 | + """ |
| 899 | + return Delivery.wrap(pn_unsettled_head(self._impl)) |
| 900 | + |
| 901 | + @property |
| 902 | + def unsettled_deliveries(self) -> Generator[Delivery]: |
| 903 | + """ |
| 904 | + Returns a generator of unsettled deliveries for this link. |
| 905 | +
|
| 906 | + :return: Generator of unsettled deliveries. |
| 907 | + """ |
| 908 | + delivery = self.unsettled_head |
| 909 | + while delivery: |
| 910 | + yield delivery |
| 911 | + delivery = delivery.unsettled_next |
| 912 | + |
891 | 913 | @property
|
892 | 914 | def credit(self) -> int:
|
893 | 915 | """
|
|
0 commit comments