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
When configuring a fallback function, the method signature is without parameters. For example:
circuit.fallback(() => { ... });
The fallback function should be able to accept the same parameters as the fire function. The fallback function, when called, should be called with these same parameters.
This will allow for parameters that can mutate the response of the fallback function.
Example usage:
// circuit setup, only called once
circuit.fallback((arg1, arg2, arg3) => {
return arg1 + arg2 + arg3;
});
// called for each request
return circuit.fire(arg1, arg2, arg3).then((response) => {
console.log(JSON.stringify(response));
});
At present, I do not have a good workaround for this.
Node.js Version:
Operating System:
Steps to Produce Error:
The text was updated successfully, but these errors were encountered:
DBG-CORE 17491: inside the constructor
DBG-CORE 17491: sets timeout to 10000
DBG-CORE 17491: sets resetTimeout to 30000
DBG-CORE 17491: creates new semaphore with capacity 9007199254740991
DBG-STATUS 17491: status created
DBG-CORE 17491: called fire function with args 20000,1,2,3 <---------
DBG-CORE 17491: fire event emitted
DBG-SEMAPHORE 17491: semaphore counter 9007199254740991
DBG-SEMAPHORE 17491: semaphore released
DBG-CORE 17491: timeout event emitted
DBG-CORE 17491: failure event emitted
DBG-CORE 17491: open event emitted
Sorry, out of service right now. But your parameters are: 20000, 1, 2 and 3 <---------
DBG-CORE 17491: fallback event emitted
fires 1 fallbacks 1
FEATURE REQUEST:
When configuring a fallback function, the method signature is without parameters. For example:
circuit.fallback(() => { ... });
The fallback function should be able to accept the same parameters as the fire function. The fallback function, when called, should be called with these same parameters.
This will allow for parameters that can mutate the response of the fallback function.
Example usage:
// circuit setup, only called once
circuit.fallback((arg1, arg2, arg3) => {
return arg1 + arg2 + arg3;
});
// called for each request
return circuit.fire(arg1, arg2, arg3).then((response) => {
console.log(JSON.stringify(response));
});
At present, I do not have a good workaround for this.
Node.js Version:
Operating System:
Steps to Produce Error:
The text was updated successfully, but these errors were encountered: