@@ -17,18 +17,19 @@ class TRoamingRequestControl
17
17
{
18
18
public:
19
19
TRoamingRequestControl (
20
- TFuture<IChannelPtr> asyncChannel,
21
20
IClientRequestPtr request,
22
21
IClientResponseHandlerPtr responseHandler,
23
22
const TSendOptions& options)
24
23
: Request_(std::move(request))
25
24
, ResponseHandler_(std::move(responseHandler))
26
25
, Options_(options)
27
- , StartTime_(TInstant::Now())
26
+ { }
27
+
28
+ void Initialize (TFuture<IChannelPtr> asyncChannel)
28
29
{
29
30
if (Options_.Timeout ) {
30
31
asyncChannel = asyncChannel.WithTimeout (*Options_.Timeout , TFutureTimeoutOptions{
31
- .Error = TError (" Error getting channel" )
32
+ .Error = TError (" Error getting channel" ),
32
33
});
33
34
}
34
35
@@ -56,7 +57,7 @@ class TRoamingRequestControl
56
57
IClientRequestPtr Request_;
57
58
IClientResponseHandlerPtr ResponseHandler_;
58
59
const TSendOptions Options_;
59
- const TInstant StartTime_;
60
+ const TInstant StartTime_ = TInstant::Now() ;
60
61
61
62
std::atomic<bool > Semaphore_ = false ;
62
63
@@ -160,11 +161,12 @@ class TRoamingChannel
160
161
}
161
162
}
162
163
163
- return New<TRoamingRequestControl>(
164
- std::move (asyncChannel),
164
+ auto control = New<TRoamingRequestControl>(
165
165
std::move (request),
166
166
std::move (responseHandler),
167
167
options);
168
+ control->Initialize (std::move (asyncChannel));
169
+ return control;
168
170
}
169
171
170
172
void Terminate (const TError& error) override
0 commit comments