File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,7 @@ namespace NActors {
125
125
if (!target) {
126
126
target = actorId;
127
127
ServiceMap->RegisterLocalService (recipient, target);
128
+ DynamicProxies.push_back (target);
128
129
}
129
130
}
130
131
if (target != actorId) {
@@ -232,10 +233,21 @@ namespace NActors {
232
233
233
234
ui32 TActorSystem::BroadcastToProxies (const std::function<IEventHandle*(const TActorId&)>& eventFabric) {
234
235
// TODO: get rid of this method
236
+ ui32 res = 0 ;
235
237
for (ui32 i = 0 ; i < InterconnectCount; ++i) {
236
238
Send (eventFabric (Interconnect[i]));
239
+ ++res;
237
240
}
238
- return InterconnectCount;
241
+
242
+ auto guard = Guard (ProxyCreationLock);
243
+ for (size_t i = 0 ; i < DynamicProxies.size (); ++i) {
244
+ const TActorId actorId = DynamicProxies[i];
245
+ auto unguard = Unguard (guard);
246
+ Send (eventFabric (actorId));
247
+ ++res;
248
+ }
249
+
250
+ return res;
239
251
}
240
252
241
253
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