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.ReliableMessage
  • Messaging
  • CallBack
  • MessageCallBackInfo.cs
Find file
BlameHistoryPermalink
  • 丁松杰's avatar
    添加 可靠消息 组件 · eb350c31
    丁松杰 committed 5 years ago
    eb350c31
MessageCallBackInfo.cs 1.08 KB
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 29 30
using Pole.ReliableMessage.Abstraction;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Pole.ReliableMessage.Messaging.CallBack
{
    public class MessageCallBackInfo
    {
        private Func<object, object, Task<bool>> _callBack;
        public MessageCallBackInfo(string messageTypeId, Func<object, object, Task<bool>> callBack, Type eventCallbackType, Type eventCallbackArguemntType,Type eventType)
        {
            MessageTypeId = messageTypeId;
            _callBack = callBack;
            EventCallbackType = eventCallbackType;
            EventCallbackArguemntType = eventCallbackArguemntType;
            EventType = eventType;
        }
        public string MessageTypeId { get;private set; }
        public Type EventType { get; private set; }
        public Type EventCallbackType { get; private set; }
        public Type EventCallbackArguemntType { get; private set; }

        public Task<bool> Invoke(object parameter, object reliableEvent)
        {
           return _callBack(parameter, reliableEvent);
        }
    }
}