Skip to content

Add 5 different task source channels - #8871

Merged
bors-servo merged 1 commit into
servo:masterfrom
KiChjang:task-source-channels
Jan 1, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
KiChjang:task-source-channels

Conversation

@KiChjang

@KiChjang KiChjang commented Dec 7, 2015

Copy link
Copy Markdown
Contributor

This is not complete. I really need feedback right away since I felt that the direction I'm heading is very wrong.

Partial #7959.

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Dec 7, 2015
@KiChjang

KiChjang commented Dec 7, 2015

Copy link
Copy Markdown
Contributor Author

I'm currently simply using MainThreadScriptChan's implementations and making 5 differently named copies of them.

Is this correct? I'm thinking that I should instead write a trait called GenericTaskSource and have all 5 task sources to impl it, but if I do so, are these task sources still supposed to be a wrapper around Senders?

@KiChjang
KiChjang force-pushed the task-source-channels branch from a69a1cf to 3928899 Compare December 7, 2015 10:55
@KiChjang KiChjang changed the title Split script_chan into 5 different task queue channels Split script_chan into 5 different task source channels Dec 7, 2015
@KiChjang
KiChjang force-pushed the task-source-channels branch 5 times, most recently from d89de93 to 1efe9dd Compare December 8, 2015 12:04
@KiChjang

KiChjang commented Dec 9, 2015

Copy link
Copy Markdown
Contributor Author

I'm also running into problems while trying to eliminate MainThreadScriptChan.

First of all, some background information - MainThreadScriptChan is simply a wrapper around Sender<MainThreadScriptMsg>. MainThreadScriptMsg is an enum that contains an algebraic data type called Common(CommonScriptMsg). When an instance of MainThreadScriptChan calls the send method, it takes in a CommonScriptMsg parameter and sends MainThreadScriptMsg:::Common(CommonScriptMsg) to the receiver.

Right now, in window.rs, fn main_thread_script_chan returns &Sender<MainThreadScriptMsg>. I'm guessing this is because callers of this function actually want to send a MainThreadScriptMsg instead of a CommonScriptMsg because there are other messages aside from Common::(CommonScriptMsg)s that you can send as a MainThreadScriptMsg.

Now here's the problem: do I still return Box<ScriptChan + Send> when I call window.dom_manipulation_task_source() or any other task source? Or do I return a &Sender<MainThreadScriptMsg> just like MainThreadScriptChan?

@KiChjang

KiChjang commented Dec 9, 2015

Copy link
Copy Markdown
Contributor Author

Ok, ignore what I said earlier in this thread; this is only a problem because I'm breaking up #7959 in manageable pieces. In a later PR, I plan to redesign the entire messaging system, so that MainThreadScriptMsg will die.

@KiChjang
KiChjang force-pushed the task-source-channels branch from 1efe9dd to 7b88dc1 Compare December 9, 2015 07:59
@KiChjang

KiChjang commented Dec 9, 2015

Copy link
Copy Markdown
Contributor Author

@bors-servo try

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 7b88dc1 with merge 50a47f8...

bors-servo pushed a commit that referenced this pull request Dec 9, 2015
Split script_chan into 5 different task source channels

This is **not** complete. I really need feedback right away since I felt that the direction I'm heading is very wrong.

Partial #7959.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8871)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt

@KiChjang KiChjang changed the title Split script_chan into 5 different task source channels Add 5 different task source channels Dec 9, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #8909) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Dec 10, 2015
@KiChjang
KiChjang force-pushed the task-source-channels branch from 7b88dc1 to f478194 Compare December 10, 2015 06:46
@nox nox removed the S-needs-rebase There are merge conflict errors. label Dec 10, 2015
@KiChjang

Copy link
Copy Markdown
Contributor Author

r? @jdm

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this isn't used now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's used for channel_for_reporter, defined just below this line.

@jdm

jdm commented Dec 30, 2015

Copy link
Copy Markdown
Member

@bors-servo: delegate+
This looks like a useful start to me as written. We can merge this with my single comment addressed.

@bors-servo

Copy link
Copy Markdown
Contributor

✌️ @KiChjang can now approve this pull request

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Dec 30, 2015
@KiChjang

KiChjang commented Jan 1, 2016

Copy link
Copy Markdown
Contributor Author

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit f478194 has been approved by KiChjang

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit f478194 with merge b8e7cd7...

bors-servo pushed a commit that referenced this pull request Jan 1, 2016
Add 5 different task source channels

This is **not** complete. I really need feedback right away since I felt that the direction I'm heading is very wrong.

Partial #7959.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8871)
<!-- Reviewable:end -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Jan 1, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt

@bors-servo
bors-servo merged commit f478194 into servo:master Jan 1, 2016
@KiChjang
KiChjang deleted the task-source-channels branch January 1, 2016 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants