Skip to content
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

Add support for Scheduler#postTask #125

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

armanbilge
Copy link
Member

@armanbilge
Copy link
Member Author

armanbilge commented Feb 25, 2025

Needs CI fix in #126. ✅ rebased

Copy link
Collaborator

@djspiewak djspiewak left a comment

Choose a reason for hiding this comment

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

I think this is great but can we get a bit of a warm fuzzy for whether or not this is actually a good idea? Like, is this actually faster than the other relevant polyfill branches?

@armanbilge
Copy link
Member Author

armanbilge commented Feb 25, 2025

whether or not this is actually a good idea

Well, putting aside measured empirical performance, this is using the Correct™ API for this sort of thing, instead of "abusing" some kind of message passing API. Indeed, the other polyfills require a supporting Map in order to pull off that trick.

var nextHandle = 1
val tasksByHandle = mutable.Map[Int, () => Unit]()
var currentlyRunningATask = false

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