File tree 2 files changed +14
-1
lines changed 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,7 @@ namespace NActors {
123
123
if (!target) {
124
124
target = actorId;
125
125
ServiceMap->RegisterLocalService (recipient, target);
126
+ DynamicProxies.push_back (target);
126
127
}
127
128
}
128
129
if (target != actorId) {
@@ -230,10 +231,21 @@ namespace NActors {
230
231
231
232
ui32 TActorSystem::BroadcastToProxies (const std::function<IEventHandle*(const TActorId&)>& eventFabric) {
232
233
// TODO: get rid of this method
234
+ ui32 res = 0 ;
233
235
for (ui32 i = 0 ; i < InterconnectCount; ++i) {
234
236
Send (eventFabric (Interconnect[i]));
237
+ ++res;
235
238
}
236
- return InterconnectCount;
239
+
240
+ auto guard = Guard (ProxyCreationLock);
241
+ for (size_t i = 0 ; i < DynamicProxies.size (); ++i) {
242
+ const TActorId actorId = DynamicProxies[i];
243
+ auto unguard = Unguard (guard);
244
+ Send (eventFabric (actorId));
245
+ ++res;
246
+ }
247
+
248
+ return res;
237
249
}
238
250
239
251
TActorId TActorSystem::LookupLocalService (const TActorId& x) const {
Original file line number Diff line number Diff line change @@ -161,6 +161,7 @@ namespace NActors {
161
161
TIntrusivePtr<NLog::TSettings> LoggerSettings0;
162
162
TProxyWrapperFactory ProxyWrapperFactory;
163
163
TMutex ProxyCreationLock;
164
+ mutable std::vector<TActorId> DynamicProxies;
164
165
165
166
bool StartExecuted;
166
167
bool StopExecuted;
You can’t perform that action at this time.
0 commit comments