-
-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor services to align with eventual RpcService (#5109)
In a future commit, we are adding an RpcService class to `network-controller` to handle automatic failovers. This class is different from the existing service classes in a couple of ways: - RpcService will make use of a new `createServicePolicy` function which encapsulates retry and circuit breaker logic. This will relieve any module that consumes RpcService from needing to test this logic. - RpcService will have `onBreak` and `onDegraded` methods instead of taking `onBreak` and `onDegraded` callbacks as constructor options. This is reflected not only in the class but also in the abstract RPC service interface. To these ends, this commit makes the following changes to `CodefiTokenPricesServiceV2` in `assets-controllers` and `ClientConfigApiService` in `remote-feature-flag-controller`: - Refactor service class to use `createServicePolicy` - Update the abstract service class interface to extend `ServicePolicy` from `controller-utils` - Deprecate the `onBreak` and `onDegraded` constructor options, and add methods instead Note that we are not including `TokenSearchApiService` in this commit, even though it is a class, because it does not use the retry or circuit breaker policy.
- Loading branch information
Showing
15 changed files
with
543 additions
and
1,164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.