public LastEventSubscriber(IEventPort channel, IFiber fiber, TimeSpan interval, Action callback) { _sub = channel.Subscribe(fiber, OnEvent); _fiber = fiber; _interval = interval; _callback = callback; }
/// <summary> /// Subscribe to a channel from the fiber. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="fiber"></param> /// <param name="channel"></param> /// <param name="handler"></param> /// <returns></returns> public static IDisposable Subscribe(this IFiber fiber, IEventPort channel, Action handler) => channel.Subscribe(fiber, handler);
SubscribeThrottled(this IEventPort port, IFiber fiber, Action receive, TimeSpan span) => new LastEventSubscriber(port, fiber, span, receive);