mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 18:02:31 +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 lastCompactedVersion;
|
||||||
Version mostRecentVersion;
|
Version mostRecentVersion;
|
||||||
std::unique_ptr<IConfigConsumer> consumer;
|
std::unique_ptr<IConfigConsumer> consumer;
|
||||||
Future<Void> consumerFuture;
|
|
||||||
ActorCollection actors{ false };
|
ActorCollection actors{ false };
|
||||||
std::vector<BroadcastClientDetails> clients;
|
std::vector<BroadcastClientDetails> clients;
|
||||||
|
|
||||||
@ -170,11 +169,11 @@ public:
|
|||||||
Future<Void> watcher,
|
Future<Void> watcher,
|
||||||
ConfigBroadcastInterface broadcastInterface) {
|
ConfigBroadcastInterface broadcastInterface) {
|
||||||
if (!consumerFuture.isValid()) {
|
if (!consumerFuture.isValid()) {
|
||||||
consumerFuture = consumer->consume(*self);
|
actors.add(consumer->consume(*self));
|
||||||
}
|
}
|
||||||
clients.push_back(BroadcastClientDetails{
|
clients.push_back(BroadcastClientDetails{
|
||||||
watcher, std::move(configClassSet), lastSeenVersion, std::move(broadcastInterface) });
|
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.
|
// Push all dynamic knobs to worker if it isn't up to date.
|
||||||
if (clients.back().lastSeenVersion >= mostRecentVersion) {
|
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; }
|
UID getID() const { return id; }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user