/// <summary>
        /// Attempts to publish the message to a listener.
        /// </summary>
        /// <param name="wrapper"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public static Task PublishAsync(this ActorReferenceWrapper wrapper, MessageWrapper message)
        {
            ISubscriberActor actor = (ISubscriberActor)wrapper.ActorReference.Bind(typeof(ISubscriberActor));

            return(actor.ReceiveMessageAsync(message));
        }
 /// <inheritdoc />
 public override Task PublishAsync(MessageWrapper message)
 {
     return(MessageWrapperExtensions.PublishAsync(this, message));
 }
Exemple #3
0
        /// <summary>
        /// Convert the provided <paramref name="messageWrapper"/> into an object of type <typeparamref name="TResult"/>
        /// </summary>
        /// <param name="messageWrapper"></param>
        /// <returns></returns>
        public static TResult CreateMessage <TResult>(this MessageWrapper messageWrapper)
        {
            var message = (PayloadSerializer ?? new DefaultPayloadSerializer()).Deserialize <TResult>(messageWrapper.Payload);

            return(message);
        }
Exemple #4
0
        /// <summary>
        /// Attempts to publish the message to a listener.
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        public override Task PublishAsync(MessageWrapper message)
        {
            var client = SubscriberServicePartitionClient.Create(ServiceReference);

            return(client.ReceiveMessageAsync(message));
        }
Exemple #5
0
 /// <summary>
 /// Attempts to publish the message to a listener.
 /// </summary>
 /// <param name="message"></param>
 /// <returns></returns>
 public abstract Task PublishAsync(MessageWrapper message);
Exemple #6
0
        /// <summary>
        /// Attempts to publish the message to a listener.
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        public override Task PublishAsync(MessageWrapper message)
        {
            ISubscriberActor actor = (ISubscriberActor)ActorReference.Bind(typeof(ISubscriberActor));

            return(actor.ReceiveMessageAsync(message));
        }