Skip to main content

Module wrappers

Module wrappers 

Source
Expand description

Registry of the strong references which keep registered components’ Python wrappers alive.

Component inners hold only a weak reference to their Python wrapper, so something must own the wrapper for as long as the component stays registered. This registry is that owner, and it is thread-local for the same reason the component and actor registries are: those hold Rc<UnsafeCell<..>> and cannot leave their thread, so a wrapper registry with wider visibility would desync from the registrations it shadows.

Functions§

get_python_wrapper
Returns the Python wrapper retained for component_id, or None when nothing is retained.
release_python_wrapper
Releases the strong reference retained for component_id.
retain_python_wrapper
Retains the strong reference which keeps the Python wrapper for component_id alive.