<commit_before>﻿namespace Eshopworld.Core
{
    using System;
    using System.Threading.Tasks;
    using JetBrains.Annotations;

    /// <summary>
    /// Contract that provides a simple way to send messages to queues.
    /// </summary>
    public interface ISendMessages : IDisposable
    {
        /// <summary>
        /// Sends a message onto a queue.
        /// </summary>
        /// <typeparam name="T">The type of the message that we are sending.</typeparam>
        /// <param name="message">The message that we are sending.</param>
        Task Send<T>([NotNull] T message) where T : class;
    }

    /// <summary>
    /// Contract that provides a simple way to send events to topics.
    /// </summary>
    public interface IPublishEvents : IDisposable
    {
        /// <summary>
        /// Sends an event onto a topic.
        /// </summary>
        /// <typeparam name="T">The type of the event that we are sending.</typeparam>
        /// <param name="event">The event that we are sending.</param>
        Task Publish<T>(T @event) where T : class;
    }


    /// <summary>
    /// Contract that provides operations at the message or event level.
    /// </summary>
    public interface IMessageOperations
    {
        /// <summary>
        /// Creates a perpetual lock on a message by continuously renewing it's lock.
        /// This is usually created at the start of a handler so that we guarantee that we still have a valid lock
        /// and we retain that lock until we finish handling the message.
        /// </summary>
        /// <param name="message">The message that we want to create the lock on.</param>
        /// <returns>The async <see cref="Task"/> wrapper</returns>        Task Lock<T>(T message) where T : class;
        Task Lock<T>(T message) where T : class;

        /// <summary>
        /// Completes a message by doing the actual READ from the queue.
        /// </summary>
        /// <param name="message">The message we want to complete.</param>
        /// <returns>The async <see cref="Task"/> wrapper</returns>
        Task Complete<T>(T message) where T : class;

        /// <summary>
        /// Abandons a message by returning it to the queue.
        /// </summary>
        /// <param name="message">The message we want to abandon.</param>
        /// <returns>The async <see cref="Task"/> wrapper</returns>
        Task Abandon<T>(T message) where T : class;

        /// <summary>
        /// Errors a message by moving it specifically to the error queue.
        /// </summary>
        /// <param name="message">The message that we want to move to the error queue.</param>
        /// <returns>The async <see cref="Task"/> wrapper</returns>
        Task Error<T>(T message) where T : class;

        /// <summary>
        /// Sets the size of the message batch during receives.
        /// </summary>
        /// <param name="batchSize">The size of the batch when reading for a queue - used as the pre-fetch parameter of the </param>
        void SetBatchSize<T>(int batchSize) where T : class;

        /// <summary>
        /// Stops receiving a message or event type by disabling the read pooling on the a message queue or topic subscription.<commit_msg>Fixed a double copy typo in the header comments<commit_after>﻿namespace Eshopworld.Core
{
    using System;
    using System.Threading.Tasks;
    using JetBrains.Annotations;

    /// <summary>
    /// Contract that provides a simple way to send messages to queues.
    /// </summary>
    public interface ISendMessages : IDisposable
    {
        /// <summary>
        /// Sends a message onto a queue.
        /// </summary>
        /// <typeparam name="T">The type of the message that we are sending.</typeparam>
        /// <param name="message">The message that we are sending.</param>
        Task Send<T>([NotNull] T message) where T : class;
    }

    /// <summary>
    /// Contract that provides a simple way to send events to topics.
    /// </summary>
    public interface IPublishEvents : IDisposable
    {
        /// <summary>
        /// Sends an event onto a topic.
        /// </summary>
        /// <typeparam name="T">The type of the event that we are sending.</typeparam>
        /// <param name="event">The event that we are sending.</param>
        Task Publish<T>(T @event) where T : class;
    }


    /// <summary>
    /// Contract that provides operations at the message or event level.
    /// </summary>
    public interface IMessageOperations
    {
        /// <summary>
        /// Creates a perpetual lock on a message by continuously renewing it's lock.
        /// This is usually created at the start of a handler so that we guarantee that we still have a valid lock
        /// and we retain that lock until we finish handling the message.
        /// </summary>
        /// <param name="message">The message that we want to create the lock on.</param>
        /// <returns>The async <see cref="Task"/> wrapper</returns>
        Task Lock<T>(T message) where T : class;

        /// <summary>
        /// Completes a message by doing the actual READ from the queue.
        /// </summary>
        /// <param name="message">The message we want to complete.</param>
        /// <returns>The async <see cref="Task"/> wrapper</returns>
        Task Complete<T>(T message) where T : class;

        /// <summary>
        /// Abandons a message by returning it to the queue.
        /// </summary>
        /// <param name="message">The message we want to abandon.</param>
        /// <returns>The async <see cref="Task"/> wrapper</returns>
        Task Abandon<T>(T message) where T : class;

        /// <summary>
        /// Errors a message by moving it specifically to the error queue.
        /// </summary>
        /// <param name="message">The message that we want to move to the error queue.</param>
        /// <returns>The async <see cref="Task"/> wrapper</returns>
        Task Error<T>(T message) where T : class;

        /// <summary>
        /// Sets the size of the message batch during receives.
        /// </summary>
        /// <param name="batchSize">The size of the batch when reading for a queue - used as the pre-fetch parameter of the </param>
        void SetBatchSize<T>(int batchSize) where T : class;

        /// <summary>
        /// Stops receiving a message or event type by disabling the read pooling on the a message queue or topic subscription.
{'fraction_non_alphanumeric': 0.12402859807273858, 'fraction_numerical': 0.0, 'mean_word_length': 2.0425531914893615, 'pattern_counts': {'":': 0, '<': 120, '<?xml version=': 0, '>': 120, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5375302', 'n_tokens_mistral': 1659, 'n_tokens_neox': 1634, 'n_words': 695}