2 minutes
Daily Update: 30th April 2023
Lovely day, had my friend imsrbh come over and we were talking about the project I wanted to do. He had some ideas and of course some experience with Kafka, so he helped me setup Kafka and docker on my machine, and that’s how it all started.
- Setting up Kafka and Docker on my machine:
- Refer to this blog for Kafka setup.
- We verified by running a sample producer-consumer app in Python and it worked.
- Starting to implement the core logic of getting key strokes in Rust
- I’m using
rdev
library for this, it was decent. - Was wondering how I can convert the keystrokes to strings, apparently it was a Rust Enum.
- Fortunately, they had a feature
serialize
which would help me do just that. Now it’s quite smooth.
- I’m using
- Implementing Kafka Producer-Consumer in Rust
- Kafka has a client in Rust,
cargo add kafka
will help. - Wrote Kafka Producer and Consumer referring to their official documentation.
- It works flawlessly.
- We were sending the keys as
&[u8]
and had to convert these to strings back at consumer (need to proper error checking there) - Producer repo: https://github.com/krshrimali/keystroke-store-rs
- Consumer repo: https://github.com/krshrimali/keystroke-consumer-rs
- Quick learning on why we didn’t go for Redis (mostly because we wanted to learn Kafka in Rust lol, can try Redis one day but I like reliability of Kafka): https://stackoverflow.com/a/37993809
- Kafka has a client in Rust,
A lot of TODOs from yesterday are left, I’ll move them to tomorrow, yay! Procrastination, let’s go 😆🎉
TODOs:
- Explore HVM: https://github.com/HigherOrderCO/HVM, looks interesting at least.
- Read through: Specifying and Verifying Higher-order Rust Iterators.
- Read through: How does async rust work
- Record a video for YouTube!
Alright, thank you all for reading. :) See y’all tomorrow!