Skip to content

Commit b4c81fc

Browse files
authored
feat(grpc): add exit_idle to LbPolicy trait (#2332)
1 parent f675352 commit b4c81fc

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

grpc/src/client/load_balancing/child_manager.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ impl<T: PartialEq + Hash + Eq + Send + Sync + 'static> LbPolicy for ChildManager
262262
self.resolve_child_controller(channel_controller, child_idx);
263263
}
264264
}
265+
266+
fn exit_idle(&mut self, _channel_controller: &mut dyn ChannelController) {
267+
todo!("implement exit_idle")
268+
}
265269
}
266270

267271
struct WrappedController<'a> {

grpc/src/client/load_balancing/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ pub trait LbPolicy: Send {
169169
/// Called by the channel in response to a call from the LB policy to the
170170
/// WorkScheduler's request_work method.
171171
fn work(&mut self, channel_controller: &mut dyn ChannelController);
172+
173+
/// Called by the channel when an LbPolicy goes idle and the channel
174+
/// wants it to start connecting to subchannels again.
175+
fn exit_idle(&mut self, channel_controller: &mut dyn ChannelController);
172176
}
173177

174178
/// Controls channel behaviors.

grpc/src/client/load_balancing/pick_first.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ impl LbPolicy for PickFirstPolicy {
9999
}
100100

101101
fn work(&mut self, channel_controller: &mut dyn ChannelController) {}
102+
103+
fn exit_idle(&mut self, _channel_controller: &mut dyn ChannelController) {
104+
todo!("implement exit_idle")
105+
}
102106
}
103107

104108
struct OneSubchannelPicker {

0 commit comments

Comments
 (0)