using System;
using System.Threading.Tasks;
using NetWorkMessage;

namespace ActorCore
{
    public delegate Task ActorHandle(ActorId fromActorId, IMessage message);

    public delegate Task ActorRpcHandle(ActorId formActorId, IRequest request, IResponse response);
    
    public interface IMailBox
    {
        MailBoxType MailBoxType
        {
            get;
        }

        /// <summary>
        /// 单帧最大处理消息的数量
        /// </summary>
        int HandleMaxMessageCount
        {
            get;
        }

        void RegisterMessageHandle(Type type, ActorHandle handle);

        void RegisterRPCHandle(Type type, ActorRpcHandle rpcHandle);
    }
}