<commit_before>﻿namespace Khala.Messaging.Azure
{
    using System;
    using System.Collections.Generic;
    using System.Threading;
    using System.Threading.Tasks;
    using Microsoft.ServiceBus.Messaging;

    /// <summary>
    /// Provides the implementation of <see cref="IMessageBus"/> for Azure Event hubs.
    /// </summary>
    public sealed class EventHubMessageBus : IMessageBus
    {
        private readonly EventDataSerializer _serializer;
        private readonly EventHubClient _eventHubClient;

        public EventHubMessageBus(
            EventHubClient eventHubClient,
            EventDataSerializer serializer)
        {
            if (serializer == null)
            {
                throw new ArgumentNullException(nameof(serializer));
            }

            if (eventHubClient == null)
            {
                throw new ArgumentNullException(nameof(eventHubClient));
            }

            _eventHubClient = eventHubClient;
            _serializer = serializer;
        }

        public EventHubMessageBus(
            EventHubClient eventHubClient,
            IMessageSerializer messageSerializer)
            : this(eventHubClient, new EventDataSerializer(messageSerializer))
        {
        }

        public EventHubMessageBus(EventHubClient eventHubClient)
            : this(eventHubClient, new EventDataSerializer())
        {
        }

        public Task Send(
            Envelope envelope,
            CancellationToken cancellationToken)
        {
            if (envelope == null)
            {
                throw new ArgumentNullException(nameof(envelope));
            }

            return SendMessage(envelope);<commit_msg>EventHubMessageBus 생성자 방어구문에 throw 식을 적용합니다.<commit_after>﻿namespace Khala.Messaging.Azure
{
    using System;
    using System.Collections.Generic;
    using System.Threading;
    using System.Threading.Tasks;
    using Microsoft.ServiceBus.Messaging;

    /// <summary>
    /// Provides the implementation of <see cref="IMessageBus"/> for Azure Event hubs.
    /// </summary>
    public sealed class EventHubMessageBus : IMessageBus
    {
        private readonly EventDataSerializer _serializer;
        private readonly EventHubClient _eventHubClient;

        public EventHubMessageBus(
            EventHubClient eventHubClient,
            EventDataSerializer serializer)
        {
            _eventHubClient = eventHubClient ?? throw new ArgumentNullException(nameof(eventHubClient));
            _serializer = serializer ?? throw new ArgumentNullException(nameof(serializer));
        }

        public EventHubMessageBus(
            EventHubClient eventHubClient,
            IMessageSerializer messageSerializer)
            : this(eventHubClient, new EventDataSerializer(messageSerializer))
        {
        }

        public EventHubMessageBus(EventHubClient eventHubClient)
            : this(eventHubClient, new EventDataSerializer())
        {
        }

        public Task Send(
            Envelope envelope,
            CancellationToken cancellationToken)
        {
            if (envelope == null)
            {
                throw new ArgumentNullException(nameof(envelope));
            }

            return SendMessage(envelope);
{'fraction_non_alphanumeric': 0.0673224715647095, 'fraction_numerical': 0.0, 'mean_word_length': 2.1258405379442844, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5396207', 'n_tokens_mistral': 785, 'n_tokens_neox': 779, 'n_words': 176}