Add mixins for using polling in data services#9352
Draft
mcmire wants to merge 1 commit into
Draft
Conversation
The `polling-controller` package contains mixins for integrating the polling pattern into a class. Using these mixins on their own is somewhat cumbersome, so the package also contains utility functions which can be used in place of a superclass. Currently, there are variants of these utility functions for controllers and non-controllers, but no variant for data services. That means if engineers want to integrate polling into data services, they are out of luck. This commit corrects that by adding two new mixins: `BlockTrackerPollingDataService` (which subscribes to the block tracker) and `StaticIntervalPollingDataService` (which runs on a cadence).
a1f1cb3 to
de71b37
Compare
mcmire
commented
Jul 1, 2026
| BaseController, | ||
| ); | ||
|
|
||
| export const BlockTrackerPollingDataService = < |
Contributor
Author
There was a problem hiding this comment.
I thought about placing these in base-data-service instead of this package, since we want to encourage engineers to use polling in data services and discourage them from using it in controllers. But then base-data-service would depend on polling-controller, and that seemed a little strange.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
The
polling-controllerpackage contains mixins for integrating the polling pattern into a class. Using these mixins on their own is somewhat cumbersome, so the package also contains utility functions which can be used in place of a superclass.Currently, there are two styles of polling supported — one that subscribes to the block tracker, the other that runs on a cadence — and then past this, there are variants of these utility functions for controllers and non-controllers.
However, there is no variant for data services. That means if engineers want to integrate polling into data services, they are out of luck. This commit corrects that by adding two new mixins:
BlockTrackerPollingDataServiceandStaticIntervalPollingDataService.References
Closes https://consensyssoftware.atlassian.net/browse/WPC-1038.
Checklist