Skip to content

feat(grpc): add exit_idle to LbPolicy trait #2332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions grpc/src/client/load_balancing/child_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ impl<T: PartialEq + Hash + Eq + Send + Sync + 'static> LbPolicy for ChildManager
self.resolve_child_controller(channel_controller, child_idx);
}
}

fn exit_idle(&mut self, _channel_controller: &mut dyn ChannelController) {
todo!("implement exit_idle")
}
}

struct WrappedController<'a> {
Expand Down
4 changes: 4 additions & 0 deletions grpc/src/client/load_balancing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ pub trait LbPolicy: Send {
/// Called by the channel in response to a call from the LB policy to the
/// WorkScheduler's request_work method.
fn work(&mut self, channel_controller: &mut dyn ChannelController);

/// Called by the channel when an LbPolicy goes idle and the channel
/// wants it to start connecting to subchannels again.
fn exit_idle(&mut self, channel_controller: &mut dyn ChannelController);
}

/// Controls channel behaviors.
Expand Down
4 changes: 4 additions & 0 deletions grpc/src/client/load_balancing/pick_first.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ impl LbPolicy for PickFirstPolicy {
}

fn work(&mut self, channel_controller: &mut dyn ChannelController) {}

fn exit_idle(&mut self, _channel_controller: &mut dyn ChannelController) {
todo!("implement exit_idle")
}
}

struct OneSubchannelPicker {
Expand Down
Loading