mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 09:58:50 +08:00
Use ActorCollection for consumer future
This commit is contained in:
parent
9f4ea02784
commit
a838a47b0b
@ -70,7 +70,6 @@ class ConfigBroadcasterImpl {
|
||||
Version lastCompactedVersion;
|
||||
Version mostRecentVersion;
|
||||
std::unique_ptr<IConfigConsumer> consumer;
|
||||
Future<Void> consumerFuture;
|
||||
ActorCollection actors{ false };
|
||||
std::vector<BroadcastClientDetails> clients;
|
||||
|
||||
@ -170,11 +169,11 @@ public:
|
||||
Future<Void> watcher,
|
||||
ConfigBroadcastInterface broadcastInterface) {
|
||||
if (!consumerFuture.isValid()) {
|
||||
consumerFuture = consumer->consume(*self);
|
||||
actors.add(consumer->consume(*self));
|
||||
}
|
||||
clients.push_back(BroadcastClientDetails{
|
||||
watcher, std::move(configClassSet), lastSeenVersion, std::move(broadcastInterface) });
|
||||
this->actors.add(waitForFailure(this, watcher, &clients.back()));
|
||||
actors.add(waitForFailure(this, watcher, &clients.back()));
|
||||
|
||||
// Push all dynamic knobs to worker if it isn't up to date.
|
||||
if (clients.back().lastSeenVersion >= mostRecentVersion) {
|
||||
@ -296,7 +295,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
Future<Void> getError() const { return consumerFuture; }
|
||||
Future<Void> getError() const { return actors.getResult(); }
|
||||
|
||||
UID getID() const { return id; }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user