Skip to content
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

Add waku-chat example #1

Merged
merged 6 commits into from
Oct 24, 2022
Merged

Conversation

zeegomo
Copy link
Contributor

@zeegomo zeegomo commented Oct 21, 2022

Add an example use of the Overwatch framework to build a very simple chat application on top of Waku

@danielSanchezQ danielSanchezQ added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 24, 2022
while let Some(NetworkEvent::RawMessage(message)) = receiver.recv().await {
if let Ok(msg) = bincode::deserialize::<Message>(&message) {
if msg.user != user {
println!(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe using tokio::io::stdout instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure the additional complexity is worth it since we can expect println! to be executed reasonably fast.
tokio::io:;stdout may also result in interleaved output.

Blocking is also the default behavior for tracing-subscriber for the reasons outlined here, so I think it makes sense to follow the same approach.
This is also an interesting read.

Copy link
Collaborator

@danielSanchezQ danielSanchezQ left a comment

Choose a reason for hiding this comment

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

🚀

@danielSanchezQ danielSanchezQ merged commit cc20ecc into logos-co:main Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants