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.Application
  • EventBus
  • ReliableEventBus.cs
Find file
BlameHistoryPermalink
  • dingsongjie's avatar
    修改 部分bug · 0ad97bd8
    dingsongjie committed 5 years ago
    0ad97bd8
ReliableEventBus.cs 831 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
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Pole.Application.EventBus
{
    public class ReliableEventBus : IEventBus
    {
        private readonly IReliableMessageScopedBuffer _reliableMessageScopedBuffer;

        public ReliableEventBus(IReliableMessageScopedBuffer reliableMessageScopedBuffer)
        {
            _reliableMessageScopedBuffer = reliableMessageScopedBuffer;
        }

        public Task Publish<TReliableEvent>(TReliableEvent @event, object callbackParemeter, CancellationToken cancellationToken = default) where TReliableEvent : class
        {
            _reliableMessageScopedBuffer.Add(new EventEntry(@event, callbackParemeter,typeof(TReliableEvent)));
            return Task.FromResult(1);
        }
    }
}