mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-25 04:43:03 +03:00
Reorganization of server options.
This commit is contained in:
parent
b7f517bafa
commit
511de3674e
@ -23,6 +23,7 @@ mingw/MosesGUI/Ui_mainWindow.py
|
||||
moses/TranslationModel/UG
|
||||
moses/server
|
||||
moses/parameters
|
||||
moses/thread_safe_container.h
|
||||
phrase-extract/pcfg-common
|
||||
phrase-extract/syntax-common
|
||||
randlm
|
||||
@ -34,3 +35,4 @@ srilm
|
||||
util
|
||||
xmlrpc-c
|
||||
.git
|
||||
util/ug_cache_with_timeout.h
|
||||
|
@ -154,7 +154,7 @@ run_as_server()
|
||||
xmlrpc_c::registry myRegistry;
|
||||
|
||||
xmlrpc_c::methodPtr const
|
||||
translator(new MosesServer::Translator(sopts.num_threads)),
|
||||
translator(new MosesServer::Translator(sopts)),
|
||||
updater(new MosesServer::Updater),
|
||||
optimizer(new MosesServer::Optimizer);
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
// -*- mode: c++; cc-style: gnu -*-
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "moses/Parameter.h"
|
||||
namespace Moses
|
||||
|
@ -2,6 +2,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "moses/ThreadPool.h"
|
||||
#include "moses/parameters/ServerOptions.h"
|
||||
#include "session.h"
|
||||
#include <xmlrpc-c/base.hpp>
|
||||
#include <xmlrpc-c/registry.hpp>
|
||||
#include <xmlrpc-c/server_abyss.hpp>
|
||||
@ -11,16 +13,19 @@
|
||||
namespace MosesServer
|
||||
{
|
||||
class
|
||||
// MosesServer::
|
||||
Translator : public xmlrpc_c::method
|
||||
Translator : public xmlrpc_c::method
|
||||
{
|
||||
Moses::ServerOptions m_server_options;
|
||||
public:
|
||||
Translator(size_t numThreads = 10);
|
||||
|
||||
Translator(Moses::ServerOptions const& sopts);
|
||||
|
||||
void execute(xmlrpc_c::paramList const& paramList,
|
||||
xmlrpc_c::value * const retvalP);
|
||||
|
||||
Session const& get_session(uint64_t session_id);
|
||||
private:
|
||||
Moses::ThreadPool m_threadPool;
|
||||
SessionCache m_session_cache;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user