using ZB.MOM.WW.ScadaBridge.Commons.Messages.Scripting;
namespace ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Scripting;
///
/// In-process, per-node publish/subscribe seam for
/// . Producers (e.g. the Transport bundle
/// importer, the ManagementActor script-editing paths) publish AFTER their mutating
/// transaction commits; consumers (e.g. the Inbound API compiled-handler cache)
/// subscribe and evict.
///
/// A conforming implementation MUST swallow-and-log any exception thrown by a
/// subscriber's handler — a misbehaving consumer must never fault a producer's
/// commit path.
///
///
public interface IScriptArtifactChangeBus
{
/// Publishes a change notification to every current subscriber. Never throws on a subscriber fault.
/// The change notification to deliver.
void Publish(ScriptArtifactsChanged notification);
/// Subscribes a handler; dispose the returned token to unsubscribe.
/// The handler invoked for each published notification.
/// A disposable that removes the subscription when disposed.
IDisposable Subscribe(Action handler);
}