Skip to content

Commit

Permalink
fix: Examples
Browse files Browse the repository at this point in the history
  • Loading branch information
can-keklik committed Jan 29, 2024
1 parent 33cacea commit 48694bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,18 @@ Lykia is a toy document database basically written for educational purposes. It
## Getting Started
To use Lykia, you can download the latest release from the GitHub releases page.

REPL:
Run the server:

```shell
$ cargo run
$ cargo run --release --bin lykiadb-server
```
Alternatively, you can run a Lykia script by passing its name as the first argument.
Run the client:

```shell
$ cargo run server/examples/fib.ly
$ cargo run --release --bin lykiadb-shell cli/examples/fib.ly
```

Client transmits the fib.ly in an infinite loop.

## License
Lykia is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.
1 change: 0 additions & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ async fn run_file(filename: &str, print_ast: bool) {

let response = session.handle().await;
println!("{:?}", response);
tokio::time::sleep(Duration::from_secs(2)).await;
}

}
Expand Down
11 changes: 5 additions & 6 deletions server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ impl ServerSession {
let bson_response = bson::to_bson(&execution.ok().or_else(|| Some(RV::Undefined)));
self.conn.write(Message::Response(Response::Value(bson_response.unwrap()))).await.unwrap();
}
self.conn
.write(Message::Response(Response::Value(
bson::to_bson(&1515).unwrap(),
)))
.await
.unwrap();
else {
let err = execution.err().unwrap();

self.conn.write(Message::Response(Response::Value(bson::to_bson(&format!("Error: {:?}", err)).unwrap()))).await.unwrap();
}
}
},
_ => panic!("Unsupported message type"),
Expand Down

0 comments on commit 48694bf

Please sign in to comment.