You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some methods, such as ui.table.context_menu, we want to provide menu action items from a callable. Meaning we need a way to notify the client of these callables, and then have the client call back when they're out of scope so they are cleaned up properly.
e.g. With a context menu call:
def_on_context_menu(cell_index: CellIndex, row_data: RowData) ->ContextMenuAction:
# This method `print_hello_world` is getting returned to the client as a result of the call to get menu items when the context menu is triggered on the clientdefprint_hello_world():
print("Hello World")
returnContextMenuAction(title="Hello World", action=print_hello_world)
# The method `_on_context_menu` gets called when the context menu is triggered on the clientui_table.context_menu(items=_on_context_menu)
So it should work for the context_menu, but be done in a generic way such that any callable that returns other objects/callables as part of the result, should retain those objects/callables until the client has instructed they can be deleted/cleaned up.
The text was updated successfully, but these errors were encountered:
Basically a cleanup function when any registered object is garbage collected. We could also add a util to explicitly cleanup and remove the object from the FinalizationRegistry.
For some methods, such as
ui.table.context_menu
, we want to provide menu action items from a callable. Meaning we need a way to notify the client of these callables, and then have the client call back when they're out of scope so they are cleaned up properly.e.g. With a context menu call:
So it should work for the context_menu, but be done in a generic way such that any callable that returns other objects/callables as part of the result, should retain those objects/callables until the client has instructed they can be deleted/cleaned up.
The text was updated successfully, but these errors were encountered: