diff options
author | nga <nga@yandex-team.ru> | 2022-02-10 16:48:09 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:09 +0300 |
commit | 1f553f46fb4f3c5eec631352cdd900a0709016af (patch) | |
tree | a231fba2c03b440becaea6c86a2702d0bfb0336e /library/cpp/messagebus/rain_check/core/env.h | |
parent | c4de7efdedc25b49cbea74bd589eecb61b55b60a (diff) | |
download | ydb-1f553f46fb4f3c5eec631352cdd900a0709016af.tar.gz |
Restoring authorship annotation for <nga@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/messagebus/rain_check/core/env.h')
-rw-r--r-- | library/cpp/messagebus/rain_check/core/env.h | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/library/cpp/messagebus/rain_check/core/env.h b/library/cpp/messagebus/rain_check/core/env.h index f6dd7fceb6..4e289dbd3d 100644 --- a/library/cpp/messagebus/rain_check/core/env.h +++ b/library/cpp/messagebus/rain_check/core/env.h @@ -1,47 +1,47 @@ -#pragma once - +#pragma once + #include "sleep.h" #include "spawn.h" - + #include <library/cpp/messagebus/actor/executor.h> - + #include <util/generic/ptr.h> - -namespace NRainCheck { - struct IEnv { - virtual ::NActor::TExecutor* GetExecutor() = 0; + +namespace NRainCheck { + struct IEnv { + virtual ::NActor::TExecutor* GetExecutor() = 0; virtual ~IEnv() { } - }; - - template <typename TSelf> - struct TEnvTemplate: public IEnv { - template <typename TTask, typename TParam> - TIntrusivePtr<typename TTask::TTaskRunner> SpawnTask(TParam param) { + }; + + template <typename TSelf> + struct TEnvTemplate: public IEnv { + template <typename TTask, typename TParam> + TIntrusivePtr<typename TTask::TTaskRunner> SpawnTask(TParam param) { return ::NRainCheck::SpawnTask<TTask, TSelf>((TSelf*)this, param); - } - }; - - template <typename TSelf> - struct TSimpleEnvTemplate: public TEnvTemplate<TSelf> { - ::NActor::TExecutorPtr Executor; - TSleepService SleepService; - - TSimpleEnvTemplate(unsigned threadCount = 0) - : Executor(new ::NActor::TExecutor(threadCount != 0 ? threadCount : 4)) + } + }; + + template <typename TSelf> + struct TSimpleEnvTemplate: public TEnvTemplate<TSelf> { + ::NActor::TExecutorPtr Executor; + TSleepService SleepService; + + TSimpleEnvTemplate(unsigned threadCount = 0) + : Executor(new ::NActor::TExecutor(threadCount != 0 ? threadCount : 4)) { } - + ::NActor::TExecutor* GetExecutor() override { return Executor.Get(); } - }; - - struct TSimpleEnv: public TSimpleEnvTemplate<TSimpleEnv> { + }; + + struct TSimpleEnv: public TSimpleEnvTemplate<TSimpleEnv> { TSimpleEnv(unsigned threadCount = 0) : TSimpleEnvTemplate<TSimpleEnv>(threadCount) { } - }; - -} + }; + +} |