/// <summary> /// Helper static creator allowing to register only one <see cref="IExecutor{AbstractMeasures}"/>, /// and start automatically the thread. /// </summary> /// <param name="executor">The consumer callback</param> /// <returns></returns> public static MeasuresExecutorsListener CreateRegisterAndStart(IExecutor <AbstractMeasures> executor) { var instance = new MeasuresExecutorsListener(); instance.RegisterExecutor(executor); instance.StartListening(); return(instance); }
/// <summary> /// Helper creator to directly register one listener associated to the measure. /// </summary> /// <param name="measuresList"></param> public static AutoMeasuresMulticasterCallback CreateAndRegister( IMeasuresAggregator <AbstractMeasures> measuresList, MeasuresExecutorsListener listerner) { var instance = new AutoMeasuresMulticasterCallback(measuresList); instance.Subscribe(listerner); return(instance); }
/// <summary> /// Remove a listener. /// </summary> /// <param name="listerner"></param> public void Unsubscribe(MeasuresExecutorsListener listerner) { _measureMulticaster.Unsubscribe(listerner); }