You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some applications / libraries perform (heavy) calculations on the service bindings returned from the ServiceBindingAccessor.
For example, service bindings should be transformed into an application internal representation.
To safe computational overhead, applications may want to cache their internal objects instead of doing the transformation each and every time when they access ServiceBindingAccess#getBindings.
Unfortunately, by doing so, application might be out of sync with the actual service bindings.
Request
It would be great if applications would get notified whenever a new set of service bindings is created / returned by a ServiceBindingAccessor instance.
Suggestions
Workaround proposal:
@RequiredArgsConstructorclassServiceBindingTransformer {
@NonnullprivatefinalServiceBindingAccessordelegate;
@NullableprivateList<ServiceBinding> lastServiceBindings;
@NullableprivateList<MyTransformedServiceBinding> transformedBindings;
@NonnullpublicList<MyTransformedServiceBinding> getTransformedBindings()
{
finalList<ServiceBinding> currentServiceBindings = delegate.getServiceBindings();
if (currentServiceBindings != lastServiceBindings || transformedBindings == null)
{
// this will only be done in case the bindings were not served from a cachetransformedBindings = transformBindings(currentServiceBindings);
lastServiceBindings = currentServiceBindings;
}
returntransformedBindings;
}
privateList<MyTransformedServiceBinding> transformBindings(@NonnullfinalList<ServiceBinding> bindings)
{
// TODO: implement me
}
}
privatestaticclassMyTransformedServiceBinding {
}
Questions
How do we solve the multi-level caching? (e.g. K8s file system cache and simple cache)
The text was updated successfully, but these errors were encountered:
Context
Some applications / libraries perform (heavy) calculations on the service bindings returned from the
ServiceBindingAccessor
.For example, service bindings should be transformed into an application internal representation.
To safe computational overhead, applications may want to cache their internal objects instead of doing the transformation each and every time when they access
ServiceBindingAccess#getBindings
.Unfortunately, by doing so, application might be out of sync with the actual service bindings.
Request
It would be great if applications would get notified whenever a new set of service bindings is created / returned by a
ServiceBindingAccessor
instance.Suggestions
Workaround proposal:
Questions
The text was updated successfully, but these errors were encountered: