This project demonstrates a simple PubSub system and a Key-Value Store implemented in Odin. The main.odin program shows how to use both together, including multi-threaded message delivery and safe memory management.
main.odin: Example usage, PubSub and KVStore implementation
- Simple in-memory key-value store
- Publish/subscribe system with multiple subscribers per topic
- Threaded message delivery to subscribers
- Demonstrates safe memory management for dynamic allocations
- Odin compiler (latest recommended)
Clone this repo and run:
odin run .You should see output similar to:
Sub1 got: Welcome to dayvster.com
Sub2 got: Welcome to dayvster.com
Sub3 got: Welcome to dayvster.com
Sub1 got: Here's another message after 2 seconds
Sub2 got: Here's another message after 2 seconds
Sub3 got: Here's another message after 2 seconds
Last in kvstore: Here's another message after 2 seconds
MIT