IIncoming.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using Edge.Core.Parser;
  2. using Edge.Core.Parser.BinaryParser.MessageEntity;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Threading;
  7. using System.Threading.Tasks;
  8. namespace Edge.Core.Processor
  9. {
  10. public interface IIncoming<TMessage> where TMessage : MessageBase
  11. {
  12. event EventHandler OnMessageIncoming;
  13. /// <summary>
  14. /// indicates it's been a while that have NOT received any messages incoming from communicator.
  15. /// if the incoming has never received a message from the begining(happened at the application just started),
  16. /// then this event will NOT fired.
  17. /// </summary>
  18. event EventHandler OnLongTimeNoSeeMessage;
  19. /// <summary>
  20. /// by ms, for control firing the event: OnLongTimeNoSeeMessageIncoming which indicates not received any msg for period time of this value specified.
  21. /// 0 will disable the feature.
  22. /// </summary>
  23. int LongTimeNoSeeMessageTimeout { get; set; }
  24. /// <summary>
  25. /// Gets or sets if should notifiy the IHandler a new message is incoming.
  26. /// this is a hook for intercept a new message to IHanlder.
  27. /// </summary>
  28. bool DisablePropagate { get; set; }
  29. TMessage Message { get; set; }
  30. }
  31. }