omnipy.shared.protocols.util
Utility protocols shared across Omnipy runtime and configuration code.
| CLASS | DESCRIPTION |
|---|---|
IsDataPublisher |
Protocol for objects that publish change notifications to subscribers. |
IsDataclass |
Protocol for objects that expose the standard dataclass marker fields. |
IsDataPublisher
Bases: Protocol
flowchart BT
omnipy.shared.protocols.util.IsDataPublisher[IsDataPublisher]
click omnipy.shared.protocols.util.IsDataPublisher href "" "omnipy.shared.protocols.util.IsDataPublisher"
Protocol for objects that publish change notifications to subscribers.
| METHOD | DESCRIPTION |
|---|---|
deepcopy |
Return a deep-copied publisher instance. |
subscribe |
Subscribe to general publisher updates. |
subscribe_attr |
Subscribe to updates for one named attribute. |
unsubscribe_all |
Remove every registered subscriber. |
Source code in src/omnipy/shared/protocols/util.py
deepcopy
Return a deep-copied publisher instance.
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Deep copy of the current publisher object.
TYPE:
|
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
IsDataclass
Bases: Protocol
flowchart BT
omnipy.shared.protocols.util.IsDataclass[IsDataclass]
click omnipy.shared.protocols.util.IsDataclass href "" "omnipy.shared.protocols.util.IsDataclass"
Protocol for objects that expose the standard dataclass marker fields.