LucidMQ

This subdirectory contains the library code for LucidMQ. LucidMQ is a library that implements event streaming directly into your application in a brokerless fashion. There is no external processes running, just import LucidMQ and start passing message though to your different applications that are also using LucidMQ.

Basic Useage

There are 4 main components that LucidMQ exposes:

```Rust use lucidmq::{LucidMQ, Message};

// Create our lucidmq instance let mut lucidmq = LucidMQ::new("basedirectory".tostring(), 1000, 5000);

// Let's produce message to our message queue let mut producer = lucidmq.newproducer("topic1".tostring()); // Create a message that you want to send. // Every message has a key, value and timestamp. let key = format!("key{}", 1); let value = format!("value{}", 1); let message = Message::new(key.asbytes(), value.asbytes(), None); producer.produce_message(message);

// Let's create a consumer to consumer our messages let mut consumer = lucidmq.newconsumer("topic1".tostring()); // Get all the messages for that polling period let records = consumer.poll(1000); // Print out all of the messages recieved. for record in records { println!("{}", str::fromutf8(&record.key).unwrap()); println!("{}", str::fromutf8(&record.value).unwrap()); println!("{}", record.timestamp); } ```