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

namespace ActorCore
{
    /// <summary>
    /// 跨进程发送器
    /// </summary>
    public interface IProcessOuterSender : IDisposable
    {

        /// <summary>
        /// Update
        /// </summary>
        void Update();
        
        /// <summary>
        /// 发送给跨进程Actor
        /// </summary>
        /// <param name="fromActorId"></param>
        /// <param name="actorId"></param>
        /// <param name="messageObject"></param>
        void Send(ActorId fromActorId, ActorId actorId, IMessage messageObject);
        
        /// <summary>
        /// 发送RPC消息
        /// </summary>
        /// <param name="fromActorId"></param>
        /// <param name="actorId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<IResponse> Call(ActorId fromActorId, ActorId actorId, IRequest request);
    }
}