Skip to content

Commit

Permalink
Reorganization of server options.
Browse files Browse the repository at this point in the history
  • Loading branch information
ugermann committed Aug 2, 2015
1 parent b7f517b commit 511de36
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .beautify-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,3 +35,4 @@ srilm
util
xmlrpc-c
.git
util/ug_cache_with_timeout.h
2 changes: 1 addition & 1 deletion moses/ExportInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions moses/parameters/ServerOptions.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// -*- mode: c++; cc-style: gnu -*-
#pragma once
#include <string>
#include "moses/Parameter.h"
namespace Moses
Expand Down
13 changes: 9 additions & 4 deletions moses/server/Translator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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;
};

}

0 comments on commit 511de36

Please sign in to comment.