be cached if the user is the author of the widget </div> <div cx-url='{{server:local}}/application/widget' cx-cache-ttl='10s' cx-cache-key='widget:user:{{cookie:userId}}' cx-timeout='1s' cx-statsd-key="widget_user"> This content will be replaced on the way through </div>
null; if( $circuitBreaker->isAvailable("UserProfileService") ){ try{ $userProfile = $userProfileService->loadProfileOrWhatever(); $circuitBreaker->reportSuccess("UserProfileService"); }catch( UserProfileServiceConnectionException $e ){ // network failed - report it as failure $circuitBreaker->reportFailure("UserProfileService"); }catch( Exception $e ){ // something went wrong but it is not service's fault, // dont report as failure } } if( $userProfile === null ){ // for example, show 'System maintenance, you cant login now.' message // but still let people buy as logged out customers. }