/// <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));
 }
Exemplo n.º 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);
        }
Exemplo n.º 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));
        }
Exemplo n.º 5
0
 /// <summary>
 /// Attempts to publish the message to a listener.
 /// </summary>
 /// <param name="message"></param>
 /// <returns></returns>
 public abstract Task PublishAsync(MessageWrapper message);
Exemplo n.º 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));
        }