<commit_before>//
//  ElasticSwiftNetworkingNIO.swift
//  ElasticSwiftNetworkingNIO
//
//  Created by <NAME> on 9/27/19.
//

import Foundation
import Logging
import NIO
import ElasticSwiftCore
import AsyncHTTPClient

//MARK:- Timeouts

public struct Timeouts {
    
    public static let DEFAULT_TIMEOUTS: Timeouts = Timeouts(read: TimeAmount.milliseconds(1000), connect: TimeAmount.milliseconds(3000))
    
    public let read: TimeAmount?
    public let connect: TimeAmount?
    
    public init(read: TimeAmount? = nil, connect: TimeAmount? = nil) {
        self.read = read
        self.connect = connect
    }
    
}

extension Timeouts: Equatable {}

//MARK:- HTTPAdaptorConfiguration

/// Class holding HTTPAdaptor Config
public class AsyncHTTPClientAdaptorConfiguration: HTTPAdaptorConfiguration {
    
    public let adaptor: ManagedHTTPClientAdaptor.Type
    
    public let clientConfig: HTTPClient.Configuration
    
    public let eventLoopProvider: HTTPClient.EventLoopGroupProvider

    public init(adaptor: ManagedHTTPClientAdaptor.Type = AsyncHTTPClientAdaptor.self, eventLoopProvider: HTTPClient.EventLoopGroupProvider = .createNew, timeouts: Timeouts? = Timeouts.DEFAULT_TIMEOUTS) {
        self.eventLoopProvider = eventLoopProvider<commit_msg>[chore] update default timeouts (read and connect) to 5sec.<commit_after>//
//  ElasticSwiftNetworkingNIO.swift
//  ElasticSwiftNetworkingNIO
//
//  Created by <NAME> on 9/27/19.
//

import Foundation
import Logging
import NIO
import ElasticSwiftCore
import AsyncHTTPClient

//MARK:- Timeouts

public struct Timeouts {
    
    public static let DEFAULT_TIMEOUTS: Timeouts = Timeouts(read: TimeAmount.milliseconds(5000), connect: TimeAmount.milliseconds(5000))
    
    public let read: TimeAmount?
    public let connect: TimeAmount?
    
    public init(read: TimeAmount? = nil, connect: TimeAmount? = nil) {
        self.read = read
        self.connect = connect
    }
    
}

extension Timeouts: Equatable {}

//MARK:- HTTPAdaptorConfiguration

/// Class holding HTTPAdaptor Config
public class AsyncHTTPClientAdaptorConfiguration: HTTPAdaptorConfiguration {
    
    public let adaptor: ManagedHTTPClientAdaptor.Type
    
    public let clientConfig: HTTPClient.Configuration
    
    public let eventLoopProvider: HTTPClient.EventLoopGroupProvider

    public init(adaptor: ManagedHTTPClientAdaptor.Type = AsyncHTTPClientAdaptor.self, eventLoopProvider: HTTPClient.EventLoopGroupProvider = .createNew, timeouts: Timeouts? = Timeouts.DEFAULT_TIMEOUTS) {
        self.eventLoopProvider = eventLoopProvider
{'fraction_non_alphanumeric': 0.07653457653457653, 'fraction_numerical': 0.01048951048951049, 'mean_word_length': 4.009727626459144, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '678181', 'n_tokens_mistral': 755, 'n_tokens_neox': 738, 'n_words': 183}