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
I'm currently implementing caching in DGS in the custom TracingInstrumentation class, where it checks for the cache-hit in beginExecution method and if cache-miss, it resumes the normal flow and persists into the cache in instrumentExecutionResult method.
Is this a good approach?
Also, the issue i'm facing is, after the cache hit, it's not exiting the beginExecution even though I'm returning a new CachedResultInstrumentationContext something like
if (cachedExecutionResult != null) {
return new CachedResultInstrumentationContext(new CachedExecutionResult(cachedExecutionResult));
} else {
return super.beginExecution(parameters);
}
CachedResultInstrumentationContext is implementing InstrumentationContext interface, so I overrided onDispatched and onCompleted methods. The execution should trigger the onDispatched method which is not happening.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently implementing caching in DGS in the custom TracingInstrumentation class, where it checks for the cache-hit in beginExecution method and if cache-miss, it resumes the normal flow and persists into the cache in instrumentExecutionResult method.
Is this a good approach?
Also, the issue i'm facing is, after the cache hit, it's not exiting the beginExecution even though I'm returning a new CachedResultInstrumentationContext something like
if (cachedExecutionResult != null) {
return new CachedResultInstrumentationContext(new CachedExecutionResult(cachedExecutionResult));
} else {
return super.beginExecution(parameters);
}
CachedResultInstrumentationContext is implementing InstrumentationContext interface, so I overrided onDispatched and onCompleted methods. The execution should trigger the onDispatched method which is not happening.
Any insights?
Beta Was this translation helpful? Give feedback.
All reactions