Simple queue
This commit is contained in:
parent
ccf033eeed
commit
4a557a7de3
@ -5,7 +5,7 @@ pub enum Msg {
|
||||
|
||||
#[derive(Debug, serde::Deserialize, serde::Serialize)]
|
||||
pub struct Message {
|
||||
pub index: usize,
|
||||
pub offset: usize,
|
||||
pub payload: Msg,
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
use flumedb::*;
|
||||
use gumdrop::Options;
|
||||
use event_bus_adapter::*;
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
enum Error {}
|
||||
@ -15,16 +16,8 @@ struct Opts {
|
||||
|
||||
#[async_std::main]
|
||||
async fn main() -> Result<(), Error> {
|
||||
let path = {
|
||||
let args = std::env::args();
|
||||
let mut iter = args.into_iter();
|
||||
iter
|
||||
.next();
|
||||
iter.next()
|
||||
.expect("Log file path not found. Please privide path to log file")
|
||||
};
|
||||
eprintln!("File: {path}");
|
||||
|
||||
let opts: Opts = Options::parse_args_default_or_exit();
|
||||
let path = opts.log_path;
|
||||
let mut log = OffsetLog::<u32>::from_file(
|
||||
std::fs::OpenOptions::new()
|
||||
.append(true)
|
||||
|
@ -17,7 +17,7 @@ impl MessageSend for MessageSender {
|
||||
async fn send(&mut self, msg: Msg) {
|
||||
match (Message {
|
||||
payload: msg,
|
||||
index: 0,
|
||||
offset: 0,
|
||||
})
|
||||
.to_bytes()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user