We'd like to use this SDK in a variety of different services were performance matters. We almost only use it with local side evaluation and in different contexts, sync, async and sometimes in async contexts but with manual future implementation, for example when implementing tower services (https://docs.rs/tower-service/latest/tower_service/).
It appears that if server side evaluation is enabled there is no need to do any fetch eagerly. Cf this related code:
if flagsmith.options.enable_local_evaluation {
// Update environment once...
if let Err(e) = update_environment(&client, &ds, &environment_url) {
log::warn!("Failed to fetch environment on initialization: {}. Will retry in background.", e);
}
with update_environment writing to the the eval_context.
It would be nice if we could split this API between local evaluation and remote evaluation because they do not actually have the same bounds. And local could work in any contexts without sync/async issues.
I'd be happy to discuss this and eventually work on this if this direction is accepted.
We'd like to use this SDK in a variety of different services were performance matters. We almost only use it with local side evaluation and in different contexts, sync, async and sometimes in async contexts but with manual future implementation, for example when implementing tower services (https://docs.rs/tower-service/latest/tower_service/).
It appears that if server side evaluation is enabled there is no need to do any fetch eagerly. Cf this related code:
with
update_environmentwriting to the theeval_context.It would be nice if we could split this API between local evaluation and remote evaluation because they do not actually have the same bounds. And local could work in any contexts without sync/async issues.
I'd be happy to discuss this and eventually work on this if this direction is accepted.