MOffline
MOffline ⇐ Trait
Kind: global class
Extends: Trait
Singleton:
Properties
Name | Type | Description |
---|---|---|
isOnline | boolean | stores the current status of the component |
backoffDelay | number | base delay used in the backoff algorithm |
backoffMaxDelay | number | maximum delay before we try to check if component is back online. |
timerManager | TimerManager | |
nbRetry | Number | count the number of times we check the component status before it goes online again |
_backoffTimerId | TimerManager | stores timer id |
enableOfflineMode | boolean | enable / disable offline mode |
- MOffline ⇐
Trait
- new MOffline()
- .checkOnline() ⇒
Promise
- .manageOfflineError(error) ⇒
Promise
MOffline()
Helper to add online/offline status on some component
checkOnline() ⇒ Promise
Check if component is online.
By default this method does not check if component is really online, it simply return the its current known status. This is because we rely on the automatic online status check behaviour, started as soon as the component becomes “offline”. It could be override to change that behaviour.
Kind: instance method of MOffline
manageOfflineError(error) ⇒ Promise
Manage error in component to check if this error could be caused by the “offline” status of the component.
Kind: instance method of MOffline
Param | Type | Description |
---|---|---|
error | Error | the error |