<commit_before>﻿namespace EasyEvents.Core
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using ClientInterfaces;
    using Configuration;
    using System.Reflection;
    using Exceptions;

    public class EasyEvents : IEasyEvents
    {
        public bool IsReplayingEvents { get; private set; }

        private static EasyEventsConfiguration _config;

        private readonly Processors _processors;
        private readonly StreamState _streamState;

        public EasyEvents()
        {
            _processors = new Processors();
            _streamState = new StreamState();
        }

        public void Configure(EasyEventsConfiguration config)
        {
            _config = config;
            config.Store.EventHandler += DispatchEvent;
        }

        public async Task RaiseEventAsync(IEvent @event)
        {
            if (IsReplayingEvents)
                return;

            PopulateDateTimeProperty(@event);

            await _config.Store.RaiseEventAsync(@event).ConfigureAwait(false);
        }

        public async Task ReplayAllEventsAsync()
        {
            IsReplayingEvents = true;<commit_msg>Fix bug where static would intermittently fail unit tests<commit_after>﻿namespace EasyEvents.Core
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using ClientInterfaces;
    using Configuration;
    using System.Reflection;
    using Exceptions;

    public class EasyEvents : IEasyEvents
    {
        public bool IsReplayingEvents { get; private set; }

        private EasyEventsConfiguration _config;

        private readonly Processors _processors;
        private readonly StreamState _streamState;

        public EasyEvents()
        {
            _processors = new Processors();
            _streamState = new StreamState();
        }

        public void Configure(EasyEventsConfiguration config)
        {
            _config = config;
            config.Store.EventHandler += DispatchEvent;
        }

        public async Task RaiseEventAsync(IEvent @event)
        {
            if (IsReplayingEvents)
                return;

            PopulateDateTimeProperty(@event);

            await _config.Store.RaiseEventAsync(@event).ConfigureAwait(false);
        }

        public async Task ReplayAllEventsAsync()
        {
            IsReplayingEvents = true;
{'fraction_non_alphanumeric': 0.0635437881873727, 'fraction_numerical': 0.0, 'mean_word_length': 2.1813471502590676, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '226709', 'n_tokens_mistral': 610, 'n_tokens_neox': 587, 'n_words': 152}