<commit_before>#pragma once

#include <functional>

#include <boost/asio.hpp>

#include <rapidjson/document.h>

#include <swarm/logger.h>
#include <swarm/urlfetcher/boost_event_loop.hpp>
#include <swarm/urlfetcher/stream.hpp>
#include <swarm/urlfetcher/url_fetcher.hpp>

#include "log.hpp"
#include "response/extract.hpp"
#include "result.hpp"
#include "request/method.hpp"

namespace elasticsearch {

class http_connection_t;

struct urlfetcher_t {
    typedef boost::asio::io_service loop_type;

    typedef ioremap::swarm::url url_type;
    typedef ioremap::swarm::simple_stream stream_type;
    typedef ioremap::swarm::url_fetcher::request request_type;
    typedef ioremap::swarm::url_fetcher::response response_type;

    loop_type& loop;
    loop_type::work work;
    ioremap::swarm::logger logger;
    ioremap::swarm::boost_event_loop loop_wrapper;
    ioremap::swarm::url_fetcher manager;

    urlfetcher_t(loop_type& loop) :
        loop(loop),
        work(loop),
        loop_wrapper(loop),
        manager(loop_wrapper, logger)<commit_msg>[Elasticsearch] No need for work object for every connection.<commit_after>#pragma once

#include <functional>

#include <boost/asio.hpp>

#include <rapidjson/document.h>

#include <swarm/logger.h>
#include <swarm/urlfetcher/boost_event_loop.hpp>
#include <swarm/urlfetcher/stream.hpp>
#include <swarm/urlfetcher/url_fetcher.hpp>

#include "log.hpp"
#include "response/extract.hpp"
#include "result.hpp"
#include "request/method.hpp"

namespace elasticsearch {

class http_connection_t;

struct urlfetcher_t {
    typedef boost::asio::io_service loop_type;

    typedef ioremap::swarm::url url_type;
    typedef ioremap::swarm::simple_stream stream_type;
    typedef ioremap::swarm::url_fetcher::request request_type;
    typedef ioremap::swarm::url_fetcher::response response_type;

    loop_type& loop;
    ioremap::swarm::logger logger;
    ioremap::swarm::boost_event_loop loop_wrapper;
    ioremap::swarm::url_fetcher manager;

    urlfetcher_t(loop_type& loop) :
        loop(loop),
        loop_wrapper(loop),
        manager(loop_wrapper, logger)
{'fraction_non_alphanumeric': 0.11823361823361823, 'fraction_numerical': 0.0, 'mean_word_length': 5.215339233038348, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '1880370', 'n_tokens_mistral': 729, 'n_tokens_neox': 715, 'n_words': 128}