Skip to content

Commit

Permalink
adding js response
Browse files Browse the repository at this point in the history
  • Loading branch information
jnumainville committed May 1, 2024
1 parent 9ec3d9a commit e624172
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export function {{ cookiecutter.__js_plugin_view_obj }}(props: WidgetComponentPr
const text = detail.getDataAsString();
if (text) {
setText(text);
widget.sendMessage("message acknowledged", []);
}
}
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import io
from typing import Any
from deephaven.plugin.object_type import MessageStream, BidirectionalObjectType

Expand Down Expand Up @@ -44,7 +45,11 @@ def on_data(self, payload: bytes, references: list[Any]) -> None:
Returns:
The payload to send to the client and the references to send to the client
"""
pass
# This is where you would process the payload.
# This is just an acknowledgement that the payload was received,
# so print.
payload = io.BytesIO(payload).read().decode()
print(f"Received payload: {payload}")

def on_close(self) -> None:
"""
Expand Down

0 comments on commit e624172

Please sign in to comment.