-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Early msgs queue for Public worker #596
Conversation
Yeah! Looks great now! 👍 |
# Conflicts: # src/agent.rs # src/app.rs
* Fix typo * Require fmt in travis script * Apply cargo format to all modules * avoid allocating in diff_classes * avoid allocating for diff_kind * avoid allocating for diff_value * simplify diff_attributes and avoid allocations * return iterator for diff_classes and diff_attributes * rustfmt on vtags * clean apply_diff * more cleaning * apply suggestions * Update proc-macro2, syn and quote to 1.0 CLOSES #590 * Fixed typo * Add support for optional callbacks to component properties * Add tests for a component with optional callback * Fix typo * Add `Classes` to prelude
any chance to merge? |
* Fix typo * Require fmt in travis script * Apply cargo format to all modules * avoid allocating in diff_classes * avoid allocating for diff_kind * avoid allocating for diff_value * simplify diff_attributes and avoid allocations * return iterator for diff_classes and diff_attributes * rustfmt on vtags * clean apply_diff * more cleaning * apply suggestions * Update proc-macro2, syn and quote to 1.0 CLOSES #590 * Fixed typo * Add support for optional callbacks to component properties * Add tests for a component with optional callback * Fix typo * Add `Classes` to prelude
* in yewstack org * Initial implementation using an iterator adaptor to provide a coherent struct to implement Into<VNode> (via From<>) for * update large table example to demonstrate new .html() method instead of 'for' * ran cargo fmt * Add a section for project templates to the README * Change org to YewStack * Implement FromIterator instead of wrapping iterator * remove dead code * ran fmt * Add extend method to Classes * change to union * renamed union back to extend * removed unused import of RangeFull
Can you run It seems like the CI is failing on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @serzhiio I took a look too and have some suggestions! Thanks for working on this, super pumped to get this merged 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of workers Id there is a real problem! What if same remote agent created dynamically, what id would it have?
If the same remote agent is created, then the |
Ok, so could help how could i send isolated commit update with fixes.
I'm not a pro with git.
ср, 25 сент. 2019 г. в 18:56, Justin Starry <notifications@github.com>:
… ***@***.**** commented on this pull request.
------------------------------
In src/agent.rs
<#596 (comment)>:
> - }
- FromWorker::ProcessOutput(id, output) => {
- let callback = slab.borrow().get(id.raw_id()).cloned();
- if let Some(callback) = callback {
- callback.emit(output);
- } else {
- warn!(
- "Id of handler for remote worker not exists <slab>: {}",
- id.raw_id()
- );
+ let handler = {
+ let slab = slab.clone();
+ move |data: Vec<u8>, worker: Value| {
+ let msg = FromWorker::<AGN::Output>::unpack(&data);
+ match msg {
+ FromWorker::WorkerLoaded => {
I think it is important, because if worker is dropped, and then spawned
later, it will seem to already be loaded
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#596?email_source=notifications&email_token=ACPXFN5SGZNGNLY2FY5WUZLQLOCZDA5CNFSM4IMLCS72YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCF43CGI#discussion_r328205665>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACPXFN4ALS6VVAF55DEIYWLQLOCZDANCNFSM4IMLCS7Q>
.
--
С Уважением,
Матыцин Сергей Леонидович
sergey.matytsin@gmail.com
|
@serzhiio you can push a new commit to your master branch :) |
@serzhiio I can help you on gitter chat |
Isnt TypeId a type unique? What if we have several workers of the same
type? It looks that typeid of AGN will be the same for all workers? No?
ср, 25 сент. 2019 г., 21:27 Justin Starry <notifications@github.com>:
… ***@***.**** requested changes on this pull request.
------------------------------
In src/agent.rs
<#596 (comment)>:
> - if let Some(callback) = callback {
- callback.emit(output);
- } else {
- warn!(
- "Id of handler for remote worker not exists <slab>: {}",
- id.raw_id()
- );
+ let handler = {
+ let slab = slab.clone();
+ move |data: Vec<u8>, worker: Value| {
+ let msg = FromWorker::<AGN::Output>::unpack(&data);
+ match msg {
+ FromWorker::WorkerLoaded => {
+ // TODO Send `Connected` message
+ let _ = REMOTE_AGENTS_LOADED.with(|local| {
+ local.borrow_mut().insert(AGN::name_of_resource())
Use TypeId::of::<AGN>() instead of AGN::name_of_resource()
------------------------------
In src/agent.rs
<#596 (comment)>:
> - "Id of handler for remote worker not exists <slab>: {}",
- id.raw_id()
- );
+ let handler = {
+ let slab = slab.clone();
+ move |data: Vec<u8>, worker: Value| {
+ let msg = FromWorker::<AGN::Output>::unpack(&data);
+ match msg {
+ FromWorker::WorkerLoaded => {
+ // TODO Send `Connected` message
+ let _ = REMOTE_AGENTS_LOADED.with(|local| {
+ local.borrow_mut().insert(AGN::name_of_resource())
+ });
+ REMOTE_AGENTS_EARLY_MSGS_QUEUE.with(|local| {
+ if let Some(msgs) =
+ local.borrow_mut().get_mut(AGN::name_of_resource())
Use TypeId::of::<AGN>() instead of AGN::name_of_resource()
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#596?email_source=notifications&email_token=ACPXFN5EGOA3EEQMHSL4ZUDQLOUR3A5CNFSM4IMLCS72YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCF5Q35Q#pullrequestreview-293277174>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACPXFN5DK5URFSSGCK5E46LQLOUR3ANCNFSM4IMLCS7Q>
.
|
Thx for explanations and your time, never used it.
Its done, fix pushed.
ср, 25 сент. 2019 г. в 21:47, Justin Starry <notifications@github.com>:
… ***@***.**** commented on this pull request.
------------------------------
In src/agent.rs
<#596 (comment)>:
> - "Id of handler for remote worker not exists <slab>: {}",
- id.raw_id()
- );
+ let handler = {
+ let slab = slab.clone();
+ move |data: Vec<u8>, worker: Value| {
+ let msg = FromWorker::<AGN::Output>::unpack(&data);
+ match msg {
+ FromWorker::WorkerLoaded => {
+ // TODO Send `Connected` message
+ let _ = REMOTE_AGENTS_LOADED.with(|local| {
+ local.borrow_mut().insert(AGN::name_of_resource())
+ });
+ REMOTE_AGENTS_EARLY_MSGS_QUEUE.with(|local| {
+ if let Some(msgs) =
+ local.borrow_mut().get_mut(AGN::name_of_resource())
@serzhiio <https://github.com/serzhiio> the TypeId will be different for
each Agent implementor since AGN is generic
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#596?email_source=notifications&email_token=ACPXFN3GOKPYOHXJVKRM3YTQLOW47A5CNFSM4IMLCS72YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCF5T4GQ#discussion_r328283777>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACPXFN7KF7TABISGDZ7EXI3QLOW47ANCNFSM4IMLCS7Q>
.
--
С Уважением,
Матыцин Сергей Леонидович
sergey.matytsin@gmail.com
|
* Implement Debug for ChildRenderer<T> * fix formatter type lifetime * remove fmt * cargo fmt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @serzhiio, very happy to have this change merge 👍
bors r+ |
596: Early msgs queue for Public worker r=jstarry a=serzhiio Fixes: #637 Co-authored-by: serzhiio <sergey.matytsin@gmail.com> Co-authored-by: Justin Starry <justin.starry@icloud.com> Co-authored-by: Henry Zimmerman <hgzimmerman@users.noreply.github.com> Co-authored-by: Terry Raimondo <terry.raimondo@gmail.com> Co-authored-by: Justin Starry <jstarry@users.noreply.github.com>
Canceled |
* Early msgs queue for Public worker * Early msgs queue for Public worker * update (#1) * Fix typo * Require fmt in travis script * Apply cargo format to all modules * ?? * Merge (yewstack#2) * Fix typo * Require fmt in travis script * Apply cargo format to all modules * avoid allocating in diff_classes * avoid allocating for diff_kind * avoid allocating for diff_value * simplify diff_attributes and avoid allocations * return iterator for diff_classes and diff_attributes * rustfmt on vtags * clean apply_diff * more cleaning * apply suggestions * Update proc-macro2, syn and quote to 1.0 CLOSES yewstack#590 * Fixed typo * Add support for optional callbacks to component properties * Add tests for a component with optional callback * Fix typo * Add `Classes` to prelude * binary ser/de issue fix * merge (yewstack#3) * Fix typo * Require fmt in travis script * Apply cargo format to all modules * avoid allocating in diff_classes * avoid allocating for diff_kind * avoid allocating for diff_value * simplify diff_attributes and avoid allocations * return iterator for diff_classes and diff_attributes * rustfmt on vtags * clean apply_diff * more cleaning * apply suggestions * Update proc-macro2, syn and quote to 1.0 CLOSES yewstack#590 * Fixed typo * Add support for optional callbacks to component properties * Add tests for a component with optional callback * Fix typo * Add `Classes` to prelude * added bincode type for data ser de * fixed Into func * Update (yewstack#5) * in yewstack org * Initial implementation using an iterator adaptor to provide a coherent struct to implement Into<VNode> (via From<>) for * update large table example to demonstrate new .html() method instead of 'for' * ran cargo fmt * Add a section for project templates to the README * Change org to YewStack * Implement FromIterator instead of wrapping iterator * remove dead code * ran fmt * Add extend method to Classes * change to union * renamed union back to extend * removed unused import of RangeFull * update * Fix touch events (yewstack#656) * Update changelog for v0.9 release (yewstack#657) * Implement Debug for ChildRenderer<T> (yewstack#655) * Implement Debug for ChildRenderer<T> * fix formatter type lifetime * remove fmt * cargo fmt * Emit initial route to router subscribers (yewstack#634) * Fix typo in RenderService (yewstack#658) * Add From<&String> for Classes implementation * @jstarry feedback - cargo fmt - rename DEDICATED_WORKERS_* to REMOTE_AGENTS_* - remove unrelated changes * TypeId ask key instead &str * Remove .gitignore changes * Update agent.rs * Update agent.rs * Fix merge conflict
Fixes: #637