Interface that allows you to create components that can be asynchronously notified.
Description
The INotifiable interface allows you to create components that can be asynchronously notified.
Important points
- The notification can include an optional argument that describes an occurred event.
Instance methods
notify
Notifies the component about an occured event.
notify(context: Optional[IContext], args: Parameters)
- context: IContext - (optional) a context to trace execution through a call chain.
- args: Parameters - notification arguments.
Examples
class MyComponent(INotifable):
...
def notify(context, args):
print("Occured event " + args.get_as_string("event"))
my_component = MyComponent()
my_component.notify("123", Parameters.from_tuples("event", "Test Event"));