<commit_before>using System.Collections.Generic;
using Journalist.EventStore.Notifications.Channels;
using Journalist.EventStore.Notifications.Formatters;
using Journalist.EventStore.Notifications.Listeners;
using Journalist.EventStore.Notifications.Timeouts;

namespace Journalist.EventStore.Notifications
{
    public class NotificationPipelineFactory : INotificationPipelineFactory
    {
        private readonly INotificationsChannel m_channel;
        private readonly IEnumerable<INotificationListener> m_listeners;
        private readonly List<NotificationHub> m_hubs;
        private readonly PollingTimeout m_pollingTimeout;
        private readonly NotificationFormatter m_notificationFormatter;

        public NotificationPipelineFactory(
            INotificationsChannel channel,
            IEnumerable<INotificationListener> listeners)
        {
            Require.NotNull(channel, "channel");
            Require.NotNull(listeners, "listeners");

            m_channel = channel;
            m_listeners = listeners;

            m_hubs = new List<NotificationHub>();
            m_pollingTimeout = new PollingTimeout();
            m_notificationFormatter = new NotificationFormatter();
        }

        public INotificationHub CreateHub()
        {
            var hub = new NotificationHub(
                m_channel,
                m_notificationFormatter,
                m_pollingTimeout);

            foreach (var notificationListener in m_listeners)
            {
                hub.Subscribe(notificationListener);
            }

            m_hubs.Add(hub);

            return hub;
        }

        public INotificationHubController CreateHubController()
        {
            return new NotificationHubController(m_hubs);
        }
    }<commit_msg>Made PollingTimeout notification hub instance specific.<commit_after>using System.Collections.Generic;
using Journalist.EventStore.Notifications.Channels;
using Journalist.EventStore.Notifications.Formatters;
using Journalist.EventStore.Notifications.Listeners;
using Journalist.EventStore.Notifications.Timeouts;

namespace Journalist.EventStore.Notifications
{
    public class NotificationPipelineFactory : INotificationPipelineFactory
    {
        private readonly INotificationsChannel m_channel;
        private readonly IEnumerable<INotificationListener> m_listeners;
        private readonly List<NotificationHub> m_hubs;
        private readonly NotificationFormatter m_notificationFormatter;

        public NotificationPipelineFactory(
            INotificationsChannel channel,
            IEnumerable<INotificationListener> listeners)
        {
            Require.NotNull(channel, "channel");
            Require.NotNull(listeners, "listeners");

            m_channel = channel;
            m_listeners = listeners;

            m_hubs = new List<NotificationHub>();
            m_notificationFormatter = new NotificationFormatter();
        }

        public INotificationHub CreateHub()
        {
            var hub = new NotificationHub(
                m_channel,
                m_notificationFormatter,
                new PollingTimeout());

            foreach (var notificationListener in m_listeners)
            {
                hub.Subscribe(notificationListener);
            }

            m_hubs.Add(hub);

            return hub;
        }

        public INotificationHubController CreateHubController()
        {
            return new NotificationHubController(m_hubs);
        }
    }
{'fraction_non_alphanumeric': 0.05984611000284981, 'fraction_numerical': 0.0, 'mean_word_length': 2.51, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1464820', 'n_tokens_mistral': 820, 'n_tokens_neox': 783, 'n_words': 167}