{"id":21654803,"url":"https://github.com/localvoid/dom_scheduler","last_synced_at":"2026-04-27T18:32:37.301Z","repository":{"id":23701466,"uuid":"27073640","full_name":"localvoid/dom_scheduler","owner":"localvoid","description":"DOM Scheduler for read/write tasks.","archived":false,"fork":false,"pushed_at":"2015-01-09T11:57:22.000Z","size":176,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-13T22:42:18.339Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/localvoid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-24T11:49:30.000Z","updated_at":"2017-10-17T15:19:46.000Z","dependencies_parsed_at":"2022-08-29T02:40:37.525Z","dependency_job_id":null,"html_url":"https://github.com/localvoid/dom_scheduler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/localvoid/dom_scheduler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localvoid%2Fdom_scheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localvoid%2Fdom_scheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localvoid%2Fdom_scheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localvoid%2Fdom_scheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/localvoid","download_url":"https://codeload.github.com/localvoid/dom_scheduler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localvoid%2Fdom_scheduler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32349528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T08:29:07.150Z","updated_at":"2026-04-27T18:32:37.286Z","avatar_url":"https://github.com/localvoid.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DOM Scheduler for read/write tasks\n\n## API\n\n### Scheduler\n\nThe scheduler algorithm is quite simple and looks like this:\n\n```dart\nwhile (writeTasks.isNotEmpty) {\n  while (writeTasks.isNotEmpty) {\n     writeTasks.removeFirst().start();\n     runMicrotasks();\n  }\n  while (readTasks.isNotEmpty) {\n    readTasks.removeFirst().start();\n    runMicrotasks();\n  }\n}\nwhile (afterTasks.isNotEmpty) {\n  afterTasks.removeFirst().start();\n  runMicrotasks();\n}\n```\n\nIt will perform write and read tasks in batches until there are no\nwrite or read tasks left.\n\nWrite tasks sorted by their priority, and the tasks with the lowest\nvalue in the priority property are executed first. It is implemented\nthis way because most of the time tasks priority will be its depth in\nthe DOM.\n\nScheduler runs in its own `Zone` and intercepts all microtasks, this\nway it is possible to use `Future`s to track dependencies between\ntasks.\n\n#### `Frame get nextFrame`\n\nReturns `Frame` that contains tasks for the next animation frame.\n\n#### `Frame get currentFrame`\n\nReturns `Frame` that contains tasks for the current animation frame.\n\n#### `Zone get zone`\n\nReturns Scheduler `Zone`.\n\n### Frame\n\n#### `Future write([int priority = maxPriority])`\n\nReturns `Future` that will be completed when Scheduler starts\nexecuting write tasks with this priority.\n\n#### `Future read()`\n\nReturns `Future` that will be completed when Scheduler starts\nexecuting read tasks.\n\n#### `Future after()`\n\nReturns `Future` that will be completed when Scheduler finishes\nexecuting all write and read tasks.\n\n## Notes\n\nIf you are planning to use something else for the write priority and\nnot depth of the node in the DOM tree, please let me know. Right now\nit is implemented in a way that is better suited for depth, and will\nbehave badly for sparse values.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalvoid%2Fdom_scheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocalvoid%2Fdom_scheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalvoid%2Fdom_scheduler/lists"}