mirror of
https://github.com/openai/codex.git
synced 2026-11-12 21:20:34 +00:00
Document cloud config loader snapshots
This commit is contained in:
@@ -207,7 +207,15 @@ impl CloudConfigBundleLoader {
|
||||
)
|
||||
}
|
||||
|
||||
/// Returns the bundle result currently published by this loader.
|
||||
///
|
||||
/// A pending loader waits for its initial result. Once a result is ready,
|
||||
/// this returns that snapshot immediately; later refreshes are observed by
|
||||
/// future calls. If the publisher is dropped before the initial result,
|
||||
/// this returns an internal lifecycle error.
|
||||
pub async fn get(&self) -> Result<Option<CloudConfigBundle>, CloudConfigBundleLoadError> {
|
||||
// Each call uses its own watch cursor so concurrent callers can wait
|
||||
// for the initial publication independently.
|
||||
let mut state = self.state.clone();
|
||||
loop {
|
||||
let result = match &*state.borrow_and_update() {
|
||||
|
||||
Reference in New Issue
Block a user