Skip to content

Implementation of simple chat#1

Open
mal20k wants to merge 3 commits intomainfrom
implementation
Open

Implementation of simple chat#1
mal20k wants to merge 3 commits intomainfrom
implementation

Conversation

@mal20k
Copy link
Owner

@mal20k mal20k commented Jul 6, 2024

Malachi Thomas Simple Chat

Demo

out

Notes

This project was used as a learning opportunity of both the tokio and ratatui crates as I have been meaning to try working with them. Using the ratatui crate helped to force separation between the frontend and the backend of the client which allowed for better integration testing.

There are fewer integration and unit tests than I would like, but that results from my unfamiliarity with tokio and the strategies that could be used to split out the non-IO functionality for more helpful unit tests. However, due to being a very IO-heavy application, it is expected that the unit tests would be relatively light.

Selected Improvements

I am using the anyhow crate for error handling and there are a few instances where errors may cause the client or server to exit prematurely. Better error handling in general is needed, and a few unwrap() calls were made in places where I was not sure about the mechanism I would like to use to handle the errors.

Logging is also not a strong point of this and would have benefited from adding the tracing crate, but adding the trace information to async applications is another thing I would need to take time to learn and the basic eprintln!() got me some helpful logs for debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant