/// <summary> /// Subscribes to a stream with a per-epoch callback applied at each worker. /// </summary> /// <typeparam name="R">record type</typeparam> /// <param name="stream">input stream</param> /// <param name="action">callback on worker id and records</param> /// <returns>subscription for synchronization</returns> public static Subscription Subscribe <R>(this Dataflow.Stream <R, Epoch> stream, Action <int, IEnumerable <R> > action) { return(stream.Subscribe((j, t, l) => action(j, l))); }
/// <summary> /// Subscribes to a stream with no callback. /// </summary> /// <typeparam name="R">record type</typeparam> /// <param name="stream">input stream</param> /// <returns>subscription for synchronization</returns> public static Subscription Subscribe <R>(this Dataflow.Stream <R, Epoch> stream) { return(stream.Subscribe(x => { })); }