Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

丁松杰 / Pole

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • Pole
  • src
  • Pole.Core
  • Channels
  • Abstractions
  • IBaseMpscChannel.cs
Find file
BlameHistoryPermalink
  • 丁松杰's avatar
    event bus 基本代码 · d9d03b97
    丁松杰 committed 5 years ago
    d9d03b97
IBaseMpscChannel.cs 850 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
using System.Threading.Tasks;

namespace Pole.Core.Channels
{
    public interface IBaseMpscChannel
    {
        /// <summary>
        /// 是否已经完成
        /// </summary>
        bool IsComplete { get; }
        /// <summary>
        /// 是否是子级channel
        /// </summary>
        bool IsChildren { get; set; }
        /// <summary>
        /// 把一个mpscchannel关联到另外一个mpscchannel,只要有消息进入,所有关联的channel都会顺序的进行消息检查和处理
        /// </summary>
        /// <param name="channel"></param>
        void JoinConsumerSequence(IBaseMpscChannel channel);
        /// <summary>
        /// 等待消息写入
        /// </summary>
        /// <returns></returns>
        Task<bool> WaitToReadAsync();
        Task ManualConsume();
        void Complete();
    }
}