<commit_before>//*****************************************************************************
//*****************************************************************************

#ifndef XBRIDGE_H
#define XBRIDGE_H

#include <deque>

#include <boost/asio.hpp>
#include <boost/thread.hpp>

//*****************************************************************************
//*****************************************************************************
class XBridge
{
    enum
    {
        THREAD_COUNT = 2,
        TIMER_INTERVAL = 20
    };

    typedef std::shared_ptr<boost::asio::io_service>       IoServicePtr;
    typedef std::shared_ptr<boost::asio::io_service::work> WorkPtr;

public:
    typedef boost::asio::ip::tcp::socket                  Socket;
    typedef std::shared_ptr<boost::asio::ip::tcp::socket> SocketPtr;

public:
    XBridge();

    void run();
    void stop();

private:
    void onTimer();

private:
    std::deque<IoServicePtr>                        m_services;
    std::deque<WorkPtr>                             m_works;
    boost::thread_group                             m_threads;

    boost::asio::io_service                         m_timerIo;
    std::shared_ptr<boost::asio::io_service::work>  m_timerIoWork;
    boost::thread                                   m_timerThread;
    boost::asio::deadline_timer                     m_timer;
};
<commit_msg>timer interval<commit_after>//*****************************************************************************
//*****************************************************************************

#ifndef XBRIDGE_H
#define XBRIDGE_H

#include <deque>

#include <boost/asio.hpp>
#include <boost/thread.hpp>

//*****************************************************************************
//*****************************************************************************
class XBridge
{
    enum
    {
        THREAD_COUNT = 2,
        TIMER_INTERVAL = 60
    };

    typedef std::shared_ptr<boost::asio::io_service>       IoServicePtr;
    typedef std::shared_ptr<boost::asio::io_service::work> WorkPtr;

public:
    typedef boost::asio::ip::tcp::socket                  Socket;
    typedef std::shared_ptr<boost::asio::ip::tcp::socket> SocketPtr;

public:
    XBridge();

    void run();
    void stop();

private:
    void onTimer();

private:
    std::deque<IoServicePtr>                        m_services;
    std::deque<WorkPtr>                             m_works;
    boost::thread_group                             m_threads;

    boost::asio::io_service                         m_timerIo;
    std::shared_ptr<boost::asio::io_service::work>  m_timerIoWork;
    boost::thread                                   m_timerThread;
    boost::asio::deadline_timer                     m_timer;
};

{'fraction_non_alphanumeric': 0.3163596966413868, 'fraction_numerical': 0.0021668472372697724, 'mean_word_length': 2.8795518207282913, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7210324', 'n_tokens_mistral': 758, 'n_tokens_neox': 677, 'n_words': 111}