Skip to content

Commit

Permalink
tag unstable functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisBiryukov91 committed Dec 4, 2024
1 parent 6c237c1 commit f2d0408
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion zenoh/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ _RustHandler = (
_PythonCallback = Callable[[_T], Any]
_PythonHandler = tuple[_PythonCallback[_T], _H]

def unstable(original):
_WARNING = "Warning: This API has been marked as unstable: it works as advertised, but it may be changed in a future release."
if original.__doc__:
original.__doc__ += "\n" + _WARNING
else:
original.__doc__ = _WARNING
return original

@final
class ZError(Exception): ...

Expand Down Expand Up @@ -349,6 +357,7 @@ class KeyExpr:
_IntoKeyExpr = KeyExpr | str

@final
@unstable
class Liveliness:
def declare_token(self, key_expr: _IntoKeyExpr) -> LivelinessToken:
"""Create a LivelinessToken for the given key expression."""
Expand Down Expand Up @@ -414,6 +423,7 @@ class Liveliness:
"""Create a Subscriber for liveliness changes matching the given key expression."""

@final
@unstable
class LivelinessToken:
def __enter__(self) -> Self: ...
def __exit__(self, *_args, **_kwargs): ...
Expand Down Expand Up @@ -484,6 +494,7 @@ class Publisher:
@property
def priority(self) -> Priority: ...
@property
@unstable
def reliability(self) -> Reliability: ...
def put(
self,
Expand Down Expand Up @@ -574,8 +585,9 @@ class Queryable(Generic[_H]):
def __iter__(self) -> Never: ...

@final
@unstable
class Querier:
"""A querier that allows to send queries to a queryable..
"""A querier that allows to send queries to a queryable.
Queriers are automatically undeclared when dropped."""

def __enter__(self) -> Self: ...
Expand Down Expand Up @@ -642,6 +654,7 @@ class QueryTarget(Enum):
DEFAULT = BEST_MATCHING

@final
@unstable
class Reliability(Enum):
BEST_EFFORT = auto()
RELIABLE = auto()
Expand Down Expand Up @@ -944,6 +957,7 @@ class Session:
) -> Publisher:
"""Create a Publisher for the given key expression."""

@unstable
def declare_querier(
self,
key_expr: _IntoKeyExpr,
Expand Down

0 comments on commit f2d0408

Please sign in to comment.