-
Notifications
You must be signed in to change notification settings - Fork 124
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
xilem_web: Add async_repeat #485
Conversation
97709ef
to
ffd00b2
Compare
This comment was marked as outdated.
This comment was marked as outdated.
ffd00b2
to
9a4dea0
Compare
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.
So the reason why this doesn't compile has to do with the two different Message
types (as well as DynMessage
). One being of xilem_core, which requires Send
and the other of xilem_web which doesn't require Send
(which is necessary to be interoperable with e.g. web_sys::Event
). See other views of xilem_web for more details.
We should probably document this, make it more clear to distinct between those two, because I've also had rust-analyzer suggesting me xilem_core::Message
while I did want to use crate::Message
.
Hmm the error message is really aweful, I wonder if it's somehow possible to improve this...
9a4dea0
to
400d934
Compare
Thank you! Now it works 😄 |
Good to know, I hope it's the same issue with The clippy suggestion is pretty dumb why CI fails... As if an endless loop doesn't have any side-effects... Anyway, that example is somewhat redundant, as that should be a use-case for the new |
But now I added the "abort handle", that might be specific to async tasks. |
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.
Same here, looks mostly good, but I think we should strive towards documenting all this stuff at this point
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Async repeat example | Xilem Web</title> |
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.
I wonder if we should call the example different (though it's most descriptive for the view at least), like interval or ping or (news-)ticker as was suggested here, and maybe add the alternative (interval
) there as well, so that people don't come to the idea to use async_repeat
, when their use case is interval
. At the very least, it should mention interval
for this use-case.
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.
I renamed it to spawn_tasks
, but that's probably not really appropriate either 🤔
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.
Apart of nits, looks good, nice job with the ShutdownSignal
.
Co-authored-by: Philipp Mildenberger <[email protected]>
Co-authored-by: Philipp Mildenberger <[email protected]>
b632608
to
b010f8f
Compare
thank you 😊 |
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.
I think you should've received an invitation to contribute.
Our merge-policy is usually that the author merges (after approval from someone else).
Otherwise looks good, so feel free to merge.
No description provided.