示例#1
0
 public LastEventSubscriber(IEventPort channel, IFiber fiber, TimeSpan interval, Action callback)
 {
     _sub      = channel.Subscribe(fiber, OnEvent);
     _fiber    = fiber;
     _interval = interval;
     _callback = callback;
 }
示例#2
0
 /// <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);
示例#3
0
 SubscribeThrottled(this IEventPort port, IFiber fiber, Action receive, TimeSpan span) =>
 new LastEventSubscriber(port, fiber, span, receive);