Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat(cdk): add native postTask scheduling support #1672

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
Loading
from
Draft

Conversation

edbzn
Copy link
Member

@edbzn edbzn commented Jan 7, 2024

This pull request introduces an initial, albeit naive, implementation of the scheduler.postTask native scheduling API. The primary goal is to gather feedback before further refinement.

Drawback of Custom Schedulers

The pull request addresses the limitation associated with custom schedulers. While it's feasible to create a custom scheduler to prioritize tasks within your controlled codebase, third-party scripts may not utilize the same scheduler. Consequently, prioritizing work becomes challenging in environments where you don't have control over all the code on the page. The alternatives are limited to chunking up tasks or explicitly yielding to user interactions. The new implementation aims to overcome these drawbacks by leveraging the native scheduler.postTask API.

Further Work

  • Task Aborting: Enhance the implementation to support task aborting, allowing for the cancellation of scheduled tasks.
  • Task Prioritization Configuration: Explore options for configuring task prioritization based on specific requirements or application needs.
  • Testing: Implement testing to ensure the reliability and compatibility of the native scheduler.postTask API integration across different browsers and environments.

@edbzn edbzn added the ✍️ Enhancement New feature or request label Jan 7, 2024
@edbzn edbzn requested a review from hoebbelsB January 7, 2024 08:36
@github-actions github-actions bot added the 🛠️ CDK CDK related label Jan 7, 2024
@@ -126,6 +169,39 @@ function scheduleOnQueue<T>(
)
);
}
function scheduleOnPostTaskQueue<T>(
work: (...args: any[]) => void,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering,

I've noticed the usage on any in many libraries, whilst Sonarqube scans recommend to replace any with unknown where possible. Sometimes it causes too strict typing and any could be preferred.

When I have a first look at this code, it seems that any could be replaced here with unknown. I'm not saying it's wrong however I wonder how serious this rule should be taken.

What is your opinion on this?

Copy link
Member

Choose a reason for hiding this comment

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

agree, unknown is better than any. This would in best case be done as part of this effort: #976 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠️ CDK CDK related ✍️ Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.