<commit_before>﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IMessageProcessingFilter.cs" company="Quartz Software SRL">
//   Copyright (c) Quartz Software SRL. All rights reserved.
// </copyright>
// <summary>
//   Application service for message processing interception.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Kephas.Messaging
{
    using System.Threading;
    using System.Threading.Tasks;

    using Kephas.Services;

    /// <summary>
    /// Application service for message processing interception.
    /// </summary>
    public interface IMessageProcessingFilter
    {
        /// <summary>
        /// Interception called before invoking the handler to process the message.
        /// </summary>
        /// <param name="context">The processing context.</param>
        /// <param name="token">The cancellation token.</param>
        /// <returns>A task.</returns>
        Task BeforeProcessAsync(IMessageProcessingContext context, CancellationToken token);

        /// <summary>
        /// Interception called after invoking the handler to process the message.
        /// </summary>
        /// <param name="context">The processing context.</param>
        /// <param name="token">The cancellation token.</param>
        /// <returns>A task.</returns>
        /// <remarks>
        /// The context will contain the response returned by the handler. 
        /// The interceptor may change the response or even replace it with another one.
        /// </remarks>
        Task AfterProcessAsync(IMessageProcessingContext context, CancellationToken token);
    }

    /// <summary>
    /// Application service for message processing interception.
    /// </summary>
    /// <typeparam name="TMessage">The type of the message.</typeparam>
    [AppServiceContract(
        AllowMultiple = true,
        ContractType = typeof(IMessageProcessingFilter),
        MetadataAttributes = new[] { typeof(MessageNameAttribute) })]
    public interface IMessageProcessingFilter<TMessage> : IMessageProcessingFilter
        where TMessage : IMessage
    {
    }
}<commit_msg>Made the processing filters shared.<commit_after>﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IMessageProcessingFilter.cs" company="Quartz Software SRL">
//   Copyright (c) Quartz Software SRL. All rights reserved.
// </copyright>
// <summary>
//   Application service for message processing interception.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Kephas.Messaging
{
    using System.Threading;
    using System.Threading.Tasks;

    using Kephas.Services;

    /// <summary>
    /// Application service for message processing interception.
    /// </summary>
    public interface IMessageProcessingFilter
    {
        /// <summary>
        /// Interception called before invoking the handler to process the message.
        /// </summary>
        /// <param name="context">The processing context.</param>
        /// <param name="token">The cancellation token.</param>
        /// <returns>A task.</returns>
        Task BeforeProcessAsync(IMessageProcessingContext context, CancellationToken token);

        /// <summary>
        /// Interception called after invoking the handler to process the message.
        /// </summary>
        /// <param name="context">The processing context.</param>
        /// <param name="token">The cancellation token.</param>
        /// <returns>A task.</returns>
        /// <remarks>
        /// The context will contain the response returned by the handler. 
        /// The interceptor may change the response or even replace it with another one.
        /// </remarks>
        Task AfterProcessAsync(IMessageProcessingContext context, CancellationToken token);
    }

    /// <summary>
    /// Application service for message processing interception.
    /// </summary>
    /// <typeparam name="TMessage">The type of the message.</typeparam>
    [SharedAppServiceContract(
        AllowMultiple = true,
        ContractType = typeof(IMessageProcessingFilter),
        MetadataAttributes = new[] { typeof(MessageNameAttribute) })]
    public interface IMessageProcessingFilter<TMessage> : IMessageProcessingFilter
        where TMessage : IMessage
    {
    }
}
{'fraction_non_alphanumeric': 0.2074770441626585, 'fraction_numerical': 0.0, 'mean_word_length': 1.8451492537313432, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 61, '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': '407905', 'n_tokens_mistral': 995, 'n_tokens_neox': 988, 'n_words': 304}