/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
cloud/blockstore/libs/endpoints/endpoint_events.cpp
50 строк
1 KB
Evgeny Budilovsky
NBS #179: switch fast path volume to regular path during migrations (#512)
28 фев 2024, 19:38
Не верифицирован
28 фев 2024, 19:38
7d4b8d4
Код
Авторство
О чём код?
#include "endpoint_events.h" namespace NCloud::NBlockStore::NServer { using namespace NThreading; namespace { //////////////////////////////////////////////////////////////////////////////// class TEndpointEventProxy: public IEndpointEventProxy { private: IEndpointEventHandlerPtr Handler; public: TFuture<NProto::TError> SwitchEndpointIfNeeded( const TString& diskId, const TString& reason) override; void Register(IEndpointEventHandlerPtr listener) override; }; //////////////////////////////////////////////////////////////////////////////// TFuture<NProto::TError> TEndpointEventProxy::SwitchEndpointIfNeeded( const TString& diskId, const TString& reason) { if (Handler) { return Handler->SwitchEndpointIfNeeded(diskId, reason); } return MakeFuture(MakeError(S_OK)); } void TEndpointEventProxy::Register(IEndpointEventHandlerPtr listener) { Handler = std::move(listener); } } // namespace //////////////////////////////////////////////////////////////////////////////// IEndpointEventProxyPtr CreateEndpointEventProxy() { return std::make_shared<TEndpointEventProxy>(); } } // namespace NCloud::NBlockStore::NServer