<commit_before>#ifndef OSRM_BINDINGS_NODE_HPP
#define OSRM_BINDINGS_NODE_HPP

#include "osrm/osrm_fwd.hpp"

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <nan.h>
#pragma GCC diagnostic pop

#include <memory>

namespace node_osrm
{

struct Engine final : public Nan::ObjectWrap
{
    using Base = Nan::ObjectWrap;

    static NAN_MODULE_INIT(Init);

    static NAN_METHOD(New);

    static NAN_METHOD(route);
    static NAN_METHOD(nearest);
    static NAN_METHOD(table);
    static NAN_METHOD(tile);
    static NAN_METHOD(match);
    static NAN_METHOD(trip);

    Engine(osrm::EngineConfig &config);

    // Thread-safe singleton accessor
    static Nan::Persistent<v8::Function> &constructor();

    // Ref-counted OSRM alive even after shutdown until last callback is done
    std::shared_ptr<osrm::OSRM> this_;
};

} // namespace node_osrm

NODE_MODULE(osrm, node_osrm::Engine::Init)

#endif<commit_msg>nodejs: user worker thread friendly initialization<commit_after>#ifndef OSRM_BINDINGS_NODE_HPP
#define OSRM_BINDINGS_NODE_HPP

#include "osrm/osrm_fwd.hpp"

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <nan.h>
#pragma GCC diagnostic pop

#include <memory>

namespace node_osrm
{

struct Engine final : public Nan::ObjectWrap
{
    using Base = Nan::ObjectWrap;

    static NAN_MODULE_INIT(Init);

    static NAN_METHOD(New);

    static NAN_METHOD(route);
    static NAN_METHOD(nearest);
    static NAN_METHOD(table);
    static NAN_METHOD(tile);
    static NAN_METHOD(match);
    static NAN_METHOD(trip);

    Engine(osrm::EngineConfig &config);

    // Thread-safe singleton accessor
    static Nan::Persistent<v8::Function> &constructor();

    // Ref-counted OSRM alive even after shutdown until last callback is done
    std::shared_ptr<osrm::OSRM> this_;
};

} // namespace node_osrm

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
NAN_MODULE_WORKER_ENABLED(osrm, node_osrm::Engine::Init)
#pragma GCC diagnostic pop

#endif
{'fraction_non_alphanumeric': 0.1002921129503408, 'fraction_numerical': 0.0009737098344693282, 'mean_word_length': 4.8215297450424925, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6246878', 'n_tokens_mistral': 697, 'n_tokens_neox': 664, 'n_words': 167}