Skip to content

Allow custom polling times#287

Open
codingLogan wants to merge 3 commits intomasterfrom
lr/CTT-122
Open

Allow custom polling times#287
codingLogan wants to merge 3 commits intomasterfrom
lr/CTT-122

Conversation

@codingLogan
Copy link
Collaborator

@codingLogan codingLogan commented Feb 6, 2026

Today the widget polls for members and jobs every 3 seconds. This adds some experimental configurability, and we'll use it to test different timings (2000ms and 1000ms polling)

Additions

New configurable polling time

Changes

switchMap is now exhaustMap in our pollers, which allows a request to finish before polling again when the interval is hit. This switch 😄 was made because if the polling is too fast the widget will not parse the response before making a new request... It would get stuck permanently in a request-but-no-response loop. (I observed this locally when testing an interval time that was too fast for the server)

Testing Instructions

When you load up the widget, pass in a value for milliseconds

experimentalFeatures={{
  ...
  memberPollingMilliseconds: 3000,
}}

* used to be switchMap
* exhaustMap ignores new emissions from the source while the current inner observable is still active.
*
* This ensures that we do not start a new poll request until the previous one has completed,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the comment adding why we added this 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, selfishly, I know if I didn't leave that comment in there, I wouldn't know why exhaustMap was used when visiting the code later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants