Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
15 changes: 10 additions & 5 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ version: 3
vars:
maybe_nightly: { sh: cargo version | grep -q 'nightly' && echo 'nightly' || echo '' }

# 2025-08-07
# temporarily omitting `nio` runtime from CI tasks
# because the latest published version of `nio` (0.0.1) fails to build
# (ref: for example, https://github.com/ohkami-rs/ohkami/pull/493#issuecomment-3146636452)

tasks:
CI:
deps:
Expand All @@ -18,7 +23,7 @@ tasks:
deps:
- task: test:tls
- task: test:no_rt
- for: [tokio, smol, nio, glommio, lambda, worker]
- for: [tokio, smol, glommio, lambda, worker] # [tokio, smol, nio, glommio, lambda, worker]
task: test:rt
vars: { rt: '{{.ITEM}}' }
test:other:
Expand All @@ -32,23 +37,23 @@ tasks:
deps:
- task: check:tls
- task: check:no_rt
- for: [tokio, smol, nio, glommio, lambda]
- for: [tokio, smol, glommio, lambda] # [tokio, smol, nio, glommio, lambda]
task: check:rt-native_target
vars: { rt: '{{.ITEM}}' }
- task: check:rt_worker

bench:dryrun:
status:
- (! cargo version | grep -q 'nightly')
- '[ "{{.maybe_nightly}}" != nightly ]' # skip if not nightly
cmds:
- cd benches && cargo bench --features DEBUG --no-run
- cd benches_rt/vs_actix-web && cargo check
- for: [tokio, smol, nio, glommio]
- for: [tokio, smol, glommio] # [tokio, smol, nio, glommio]
cmd: cd benches_rt/{{.ITEM}} && cargo check

bench:
status:
- (! cargo version | grep -q 'nightly')
- '[ "{{.maybe_nightly}}" != nightly ]' # skip if not nightly
dir: ./benches
cmds:
- task: bench:dryrun
Expand Down
2 changes: 1 addition & 1 deletion benches_rt/glommio/src/bin/param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use glommio::{LocalExecutorPoolBuilder, PoolPlacement, CpuSet};


#[inline(always)]
async fn echo_id(id: String) -> String {
async fn echo_id(Path(id): Path<String>) -> String {
id
}

Expand Down
2 changes: 1 addition & 1 deletion benches_rt/nio/src/bin/param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ use ohkami::prelude::*;
async fn main() {
Ohkami::new((
"/user/:id"
.GET(|id: String| async {id}),
.GET(|Path(id): Path<String>| async {id}),
)).howl("0.0.0.0:3000").await
}
2 changes: 1 addition & 1 deletion benches_rt/smol/src/bin/param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use ohkami::prelude::*;


#[inline(always)]
async fn echo_id(id: String) -> String {
async fn echo_id(Path(id): Path<String>) -> String {
id
}

Expand Down
4 changes: 2 additions & 2 deletions benches_rt/tokio/src/bin/hello.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use ohkami::prelude::*;
use ohkami::format::Json;
use ohkami::format::{Path, Json};

#[derive(Serialize)]
struct Message {
message: String
}

async fn hello(name: &str) -> Json<Message> {
async fn hello(Path(name): Path<&str>) -> Json<Message> {
Json(Message {
message: format!("Hello, {name}!")
})
Expand Down
2 changes: 1 addition & 1 deletion benches_rt/tokio/src/bin/param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ fn main() {
.expect("Failed building the Runtime")
.block_on(Ohkami::new((
"/user/:id"
.GET(|id: String| async {id}),
.GET(|Path(id): Path<String>| async {id}),
)).howl("0.0.0.0:3000"))
}
2 changes: 1 addition & 1 deletion benches_rt/tokio/src/bin/sleep.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ohkami::prelude::*;

async fn sleeping_hello(secs: u64) -> &'static str {
async fn sleeping_hello(Path(secs): Path<u64>) -> &'static str {
tokio::time::sleep(std::time::Duration::from_secs(secs)).await;
"Hello, sleep!"
}
Expand Down