Skip to content

Commit

Permalink
fix: make TableListenerHandle a JObjectWrapper again (#5713)
Browse files Browse the repository at this point in the history
So that it can be directly added to LivenessScope

Fixes #5711
  • Loading branch information
jmao-denver authored Jul 6, 2024
1 parent 99b9c3d commit 2d6bf4b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion py/server/deephaven/table_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,9 @@ def _wrap_listener_obj(t: Table, listener: TableListener):
return listener


class TableListenerHandle:
class TableListenerHandle(JObjectWrapper):
"""A handle to manage a table listener's lifecycle."""
j_object_type = _JPythonReplayListenerAdapter

def __init__(self, t: Table, listener: Union[Callable, TableListener], description: str = None,
dependencies: Union[Table, Sequence[Table]] = None):
Expand Down Expand Up @@ -364,6 +365,10 @@ def __init__(self, t: Table, listener: Union[Callable, TableListener], descripti
raise DHError(e, "failed to create a table listener.") from e
self.started = False

@property
def j_object(self) -> jpy.JType:
return self.listener

def start(self, do_replay: bool = False, replay_lock: Literal["shared", "exclusive"] = "shared") -> None:
"""Start the listener by registering it with the table and listening for updates.
Expand Down

0 comments on commit 2d6bf4b

Please sign in to comment.