Skip to content

Unify Window task sources and task cancellers API #21154

Closed

Description

@gterzian

#21126 (comment)

we should do something to avoid all of the duplication of calling foo_task_source and then getting a canceller where it's easy to end up with one for a different source. Possibly the foo_task_source APIs could return both a source and a canceller at the same time.

Note there are two current use-cases:

  1. A script-thread task is enqueued 'directly from the main script-thread/event-loop', like in
    let _ = window.dom_manipulation_task_source().queue(
    where TaskSource.queue is called, and the task source itself is responsible for 'selecting' the right task canceller for the queued task.
  2. A script-thread task is enqueued 'from code running in parallel', like in
    task_source.queue_with_canceller(task, &canceller).unwrap();
    where queue_with_canceller is called directly from the parallel steps of the algorithm.

Activity

  1. gterzian commented on Sep 21, 2018

    @gterzian
    MemberAuthor

    @AgustinCB This one could be of interest to you as well, given your prior work with task-sources(or perhaps you'd rather do other things actually :) )

    It's not completely clear what such "unified API" should look like, so this will require some initial exploration with the code...

  2. AgustinCB commented on Sep 21, 2018

    @AgustinCB

    Awesome! Will give it a try. Thanks for letting me know!

  3. AgustinCB commented on Sep 23, 2018

    @AgustinCB

    I'll have a PR for this tomorrow, hopefully.

  4. added 2 commits that reference this issue on Oct 3, 2018
    594dd5e
    f5df185
  5. added 2 commits that reference this issue on Nov 13, 2018
    8b47358
    a2937d9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions