INotifiable

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

NotifyAsync

Notifies the component about occured event.

Task NotifyAsync(string correlationId, Parameters args)

  • correlationId: string - (optional) transaction id to trace execution through call chain.
  • args: Parameters - notification arguments.

Examples

class MyComponent: INotifable 
{
    ...
    public void Notify(string correlationId, Parameters args)
    {
        Console.WriteLine("Occured event " + args.GetAsString("event"));
    }
}
var myComponent = new MyComponent();
myComponent.Notify("123", Parameters.FromTuples("event", "Test Event"));

See also