fn r#_GetCacheEntry_k()

in releases/rust/esdk/src/storm_tracker.rs [50:89]


    fn r#_GetCacheEntry_k(&self, input: &dafny_runtime::Rc<crate::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryInput>)
    -> dafny_runtime::Rc<crate::_Wrappers_Compile::Result<dafny_runtime::Rc<crate::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryOutput>, dafny_runtime::Rc<crate::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
    {
        let max_in_flight = crate::Time::_default::CurrentRelativeTimeMilli() + unsafe { *(*self.wrapped.lock().unwrap()).as_ref().inFlightTTL.get() };
        let sleep_milli = unsafe { *(*self.wrapped.lock().unwrap()).as_ref().sleepMilli.get() };
        let sleep_time = Duration::from_millis(sleep_milli as u64);
        loop {
            let result = self.wrapped.lock().unwrap().as_mut().GetFromCache(input);
            match &*result {
                crate::_Wrappers_Compile::Result::Failure{error} => {return dafny_runtime::Rc::new(crate::_Wrappers_Compile::Result::Failure{error : error.clone()});}
                crate::_Wrappers_Compile::Result::Success{value} => {
                    match &**value {
                        Full { data } => { return dafny_runtime::Rc::new(crate::_Wrappers_Compile::Result::Success{value : data.clone()}); }
                        EmptyFetch {} => {
                            return dafny_runtime::Rc::new(crate::_Wrappers_Compile::Result::Failure{error :
                                dafny_runtime::Rc::new(crate::software::amazon::cryptography::materialproviders::internaldafny::types::Error::EntryDoesNotExist { message:
                                    dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(
                                        "Entry does not exist"
                                    )
                                },
                            )});
                        }
                        EmptyWait {} => {
                            if crate::Time::_default::CurrentRelativeTimeMilli() <= max_in_flight {
                                std::thread::sleep(sleep_time);
                            } else {
                                return dafny_runtime::Rc::new(crate::_Wrappers_Compile::Result::Failure{error :
                                    dafny_runtime::Rc::new(crate::software::amazon::cryptography::materialproviders::internaldafny::types::Error::InFlightTTLExceeded { message:
                                        dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(
                                            "Storm cache inFlightTTL exceeded"
                                        )
                                    },
                                )});
                            }
                        }
                    }
                }
            }
        }
      }