omnipy.shared.protocols.hub.runtime
Protocols for runtime configuration, objects, and root logging.
| CLASS | DESCRIPTION |
|---|---|
IsRootLogObjects |
Protocol for root logger helper objects. |
IsRuntime |
Protocol for the Omnipy runtime container. |
IsRuntimeConfig |
Protocol for the aggregated runtime configuration. |
IsRuntimeObjects |
Protocol for the instantiated objects owned by the runtime. |
IsRootLogObjects
Bases: Protocol
flowchart BT
omnipy.shared.protocols.hub.runtime.IsRootLogObjects[IsRootLogObjects]
click omnipy.shared.protocols.hub.runtime.IsRootLogObjects href "" "omnipy.shared.protocols.hub.runtime.IsRootLogObjects"
Protocol for root logger helper objects.
| METHOD | DESCRIPTION |
|---|---|
set_config |
Replace root logging configuration and rebuild logging objects. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
config |
Return the active root logging configuration.
TYPE:
|
file_handler |
TYPE:
|
formatter |
TYPE:
|
stderr_handler |
TYPE:
|
stdout_handler |
TYPE:
|
Source code in src/omnipy/shared/protocols/hub/runtime.py
config
property
config: IsRootLogConfig
Return the active root logging configuration.
| RETURNS | DESCRIPTION |
|---|---|
IsRootLogConfig
|
Configuration currently used to construct formatter and handlers.
TYPE:
|
stderr_handler
class-attribute
instance-attribute
stdout_handler
class-attribute
instance-attribute
set_config
set_config(config: IsRootLogConfig) -> None
Replace root logging configuration and rebuild logging objects.
| PARAMETER | DESCRIPTION |
|---|---|
config
|
New root logger configuration to apply.
TYPE:
|
Source code in src/omnipy/shared/protocols/hub/runtime.py
IsRuntime
Bases: Protocol
flowchart BT
omnipy.shared.protocols.hub.runtime.IsRuntime[IsRuntime]
click omnipy.shared.protocols.hub.runtime.IsRuntime href "" "omnipy.shared.protocols.hub.runtime.IsRuntime"
Protocol for the Omnipy runtime container.
| METHOD | DESCRIPTION |
|---|---|
reset_subscriptions |
Reset runtime subscriptions between config and runtime objects. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
config |
TYPE:
|
objects |
TYPE:
|
Source code in src/omnipy/shared/protocols/hub/runtime.py
reset_subscriptions
Reset runtime subscriptions between config and runtime objects.
This method rebuilds the callback graph that keeps configuration, engines, registries, logging, and reactive UI objects synchronized. Call it after replacing runtime subobjects manually.
| RAISES | DESCRIPTION |
|---|---|
AssertionError
|
If a Jupyter UI is detected but reactive objects are unexpectedly missing. |
Source code in src/omnipy/shared/protocols/hub/runtime.py
IsRuntimeConfig
Bases: IsConfigBase, Protocol
flowchart BT
omnipy.shared.protocols.hub.runtime.IsRuntimeConfig[IsRuntimeConfig]
omnipy.shared.protocols.config.IsConfigBase[IsConfigBase]
omnipy.shared.protocols.util.IsDataPublisher[IsDataPublisher]
omnipy.shared.protocols.config.IsConfigBase --> omnipy.shared.protocols.hub.runtime.IsRuntimeConfig
omnipy.shared.protocols.util.IsDataPublisher --> omnipy.shared.protocols.config.IsConfigBase
click omnipy.shared.protocols.hub.runtime.IsRuntimeConfig href "" "omnipy.shared.protocols.hub.runtime.IsRuntimeConfig"
click omnipy.shared.protocols.config.IsConfigBase href "" "omnipy.shared.protocols.config.IsConfigBase"
click omnipy.shared.protocols.util.IsDataPublisher href "" "omnipy.shared.protocols.util.IsDataPublisher"
Protocol for the aggregated runtime configuration.
| METHOD | DESCRIPTION |
|---|---|
as_model |
|
deepcopy |
Return a deep-copied publisher instance. |
default_repr_to_terminal_str |
Render the config for a terminal-style user interface. |
reset_to_defaults |
Reset all runtime configuration sections to their default values. |
subscribe |
Subscribe to general publisher updates. |
subscribe_attr |
Subscribe to updates for one named attribute. |
unsubscribe_all |
Remove every registered subscriber. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
data |
TYPE:
|
engine |
TYPE:
|
job |
TYPE:
|
root_log |
TYPE:
|
Source code in src/omnipy/shared/protocols/hub/runtime.py
as_model
as_model() -> IsModel[Any]
deepcopy
Return a deep-copied publisher instance.
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Deep copy of the current publisher object.
TYPE:
|
default_repr_to_terminal_str
default_repr_to_terminal_str(ui_type: TerminalOutputUserInterfaceType.Literals) -> str
Render the config for a terminal-style user interface.
| PARAMETER | DESCRIPTION |
|---|---|
ui_type
|
Terminal frontend variant requesting the representation. |
| RETURNS | DESCRIPTION |
|---|---|
str
|
Terminal-friendly string representation of the config.
TYPE:
|
Source code in src/omnipy/shared/protocols/config.py
reset_to_defaults
Reset all runtime configuration sections to their default values.
Rebuilds the data, engine, job, and root-log config sections and then refreshes runtime subscriptions when the config is attached to a runtime object.
Source code in src/omnipy/shared/protocols/hub/runtime.py
subscribe
Subscribe to general publisher updates.
| PARAMETER | DESCRIPTION |
|---|---|
callback_fun
|
Callback invoked when the publisher changes.
TYPE:
|
do_callback
|
Whether to invoke the callback immediately after subscribing.
TYPE:
|
Source code in src/omnipy/shared/protocols/util.py
subscribe_attr
Subscribe to updates for one named attribute.
| PARAMETER | DESCRIPTION |
|---|---|
attr_name
|
Name of the published attribute to observe.
TYPE:
|
callback_fun
|
Callback invoked when that attribute changes.
TYPE:
|
Source code in src/omnipy/shared/protocols/util.py
IsRuntimeObjects
Bases: IsDataPublisher, Protocol
flowchart BT
omnipy.shared.protocols.hub.runtime.IsRuntimeObjects[IsRuntimeObjects]
omnipy.shared.protocols.util.IsDataPublisher[IsDataPublisher]
omnipy.shared.protocols.util.IsDataPublisher --> omnipy.shared.protocols.hub.runtime.IsRuntimeObjects
click omnipy.shared.protocols.hub.runtime.IsRuntimeObjects href "" "omnipy.shared.protocols.hub.runtime.IsRuntimeObjects"
click omnipy.shared.protocols.util.IsDataPublisher href "" "omnipy.shared.protocols.util.IsDataPublisher"
Protocol for the instantiated objects owned by the runtime.
| METHOD | DESCRIPTION |
|---|---|
deepcopy |
Return a deep-copied publisher instance. |
setup_reactive |
Create or remove reactive UI helpers for the detected interface. |
subscribe |
Subscribe to general publisher updates. |
subscribe_attr |
Subscribe to updates for one named attribute. |
unsubscribe_all |
Remove every registered subscriber. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
data_class_creator |
TYPE:
|
job_creator |
TYPE:
|
local |
TYPE:
|
prefect |
TYPE:
|
reactive |
TYPE:
|
registry |
TYPE:
|
root_log |
TYPE:
|
serializers |
TYPE:
|
Source code in src/omnipy/shared/protocols/hub/runtime.py
deepcopy
Return a deep-copied publisher instance.
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Deep copy of the current publisher object.
TYPE:
|
setup_reactive
setup_reactive(ui_type: UserInterfaceType.Literals) -> None
Create or remove reactive UI helpers for the detected interface.
| PARAMETER | DESCRIPTION |
|---|---|
ui_type
|
Detected user-interface type for the current runtime.
TYPE:
|
Source code in src/omnipy/shared/protocols/hub/runtime.py
subscribe
Subscribe to general publisher updates.
| PARAMETER | DESCRIPTION |
|---|---|
callback_fun
|
Callback invoked when the publisher changes.
TYPE:
|
do_callback
|
Whether to invoke the callback immediately after subscribing.
TYPE:
|
Source code in src/omnipy/shared/protocols/util.py
subscribe_attr
Subscribe to updates for one named attribute.
| PARAMETER | DESCRIPTION |
|---|---|
attr_name
|
Name of the published attribute to observe.
TYPE:
|
callback_fun
|
Callback invoked when that attribute changes.
TYPE:
|