Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust: bump ohkami to v0.21 #8180

Merged
merged 4 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rust/ohkami/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ rpath = false
strip = false

[dependencies]
ohkami = { version = "0.20", features = ["rt_tokio"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
ohkami = { version = "0.21", features = ["rt_nio"] }
nio = { version = "0.0" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the idea of this 0.0 ?

Copy link
Contributor Author

@kanarus kanarus Jan 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I forgot to chage features to ["rt_nio"] from ["rt_tokio"].
I'm trying nio experimental runtime instead of tokio here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you then create okhami-nio and okhami-tokio ?

as we have for javascript with -bun and -deno

2 changes: 1 addition & 1 deletion rust/ohkami/config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
framework:
github: ohkami-rs/ohkami
version: 0.20
version: 0.21
13 changes: 3 additions & 10 deletions rust/ohkami/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
use ohkami::prelude::*;

fn benchmark_ohkami() -> Ohkami {
#[nio::main]
async fn main() {
Ohkami::new((
"/"
.GET(|| async {Response::OK()}),
"/user"
.POST(|| async {Response::OK()}),
"/user/:id"
.GET(|id: String| async {id}),
))
}

fn main() {
tokio::runtime::Builder::new_multi_thread()
.enable_all()
.event_interval(1)
.build().unwrap()
.block_on(benchmark_ohkami().howl("0.0.0.0:3000"))
)).howl("0.0.0.0:3000").await
}
Loading