Exemple #1
0
        /// <summary>
        ///   Publishes an event to a list of actors on a specified channel.
        /// </summary>
        /// <param name = "e">
        ///   The event to publish.
        /// </param>
        /// <param name = "actorList">
        ///   A list of <see cref = "Actor" /> who should receive the event.
        /// </param>
        /// <param name = "sendParameters">
        ///   The send Parameters.
        /// </param>
        protected void PublishEvent(HiveEventBase e, IEnumerable <Actor> actorList, SendParameters sendParameters)
        {
            var peers     = actorList.Select(actor => actor.Peer);
            var eventData = new EventData(e.Code, e);

            ApplicationBase.Instance.BroadCastEvent(eventData, peers, sendParameters);
        }
Exemple #2
0
        /// <summary>
        ///   Publishes an event to a single actor on a specified channel.
        /// </summary>
        /// <param name = "e">
        ///   The event to publish.
        /// </param>
        /// <param name = "actor">
        ///   The <see cref = "Actor" /> who should receive the event.
        /// </param>
        /// <param name = "sendParameters">
        ///   The send Parameters.
        /// </param>
        protected void PublishEvent(HiveEventBase e, Actor actor, SendParameters sendParameters)
        {
            var eventData = new EventData(e.Code, e);

            actor.Peer.SendEvent(eventData, sendParameters);
        }