diff options
author | vladimir <vladimir@yandex-team.ru> | 2022-02-10 16:50:28 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:28 +0300 |
commit | 3e7ff6e4ee637c04455854159e84850e613ebc16 (patch) | |
tree | 1ea1786a47f104a0657e0f935ce63dcaeec3fd26 /library/cpp/messagebus/oldmodule/startsession.cpp | |
parent | dad82c0e0157ebad6bfd7cf0e5fb3c15c42922b3 (diff) | |
download | ydb-3e7ff6e4ee637c04455854159e84850e613ebc16.tar.gz |
Restoring authorship annotation for <vladimir@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/messagebus/oldmodule/startsession.cpp')
-rw-r--r-- | library/cpp/messagebus/oldmodule/startsession.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/library/cpp/messagebus/oldmodule/startsession.cpp b/library/cpp/messagebus/oldmodule/startsession.cpp index 7c38801d62..8126e11530 100644 --- a/library/cpp/messagebus/oldmodule/startsession.cpp +++ b/library/cpp/messagebus/oldmodule/startsession.cpp @@ -1,19 +1,19 @@ -/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// /// \file -/// \brief Starter session implementation +/// \brief Starter session implementation -/// Starter session will generate emtpy message to insert -/// into local session that are registered under same protocol +/// Starter session will generate emtpy message to insert +/// into local session that are registered under same protocol -/// Starter (will one day) automatically adjust number -/// of message inflight to make sure that at least one of source -/// sessions within message queue is at the limit (bottle neck) - -/// Maximum number of messages that starter will instert into -/// the pipeline is configured by NBus::TBusSessionConfig::MaxInFlight - -#include "startsession.h" +/// Starter (will one day) automatically adjust number +/// of message inflight to make sure that at least one of source +/// sessions within message queue is at the limit (bottle neck) +/// Maximum number of messages that starter will instert into +/// the pipeline is configured by NBus::TBusSessionConfig::MaxInFlight + +#include "startsession.h" + #include "module.h" #include <library/cpp/messagebus/ybus.h> @@ -24,7 +24,7 @@ namespace NBus { pThis->Starter(); return nullptr; } - + TBusStarter::TBusStarter(TBusModule* module, const TBusSessionConfig& config) : Module(module) , Config(config) @@ -33,11 +33,11 @@ namespace NBus { { StartThread.Start(); } - + TBusStarter::~TBusStarter() { Shutdown(); } - + void TBusStarter::Shutdown() { { TGuard<TMutex> g(ExitLock); @@ -46,20 +46,20 @@ namespace NBus { } StartThread.Join(); } - + void TBusStarter::Starter() { TGuard<TMutex> g(ExitLock); while (!Exiting) { TAutoPtr<TBusMessage> empty(new TBusMessage(0)); - + EMessageStatus status = Module->StartJob(empty); - + if (Config.SendTimeout > 0) { ExitSignal.WaitT(ExitLock, TDuration::MilliSeconds(Config.SendTimeout)); } else { ExitSignal.WaitT(ExitLock, (status == MESSAGE_BUSY) ? TDuration::MilliSeconds(1) : TDuration::Zero()); } - } - } + } + } } |