zpp-2022-rust-seastar / seastar-rs

Idiomatic Rust bindings to the Seastar framework
6 stars 3 forks source link

Submit to #35

Closed grzenow4 closed 1 year ago

grzenow4 commented 1 year ago

Fixes: #15 Depends on: #2

This PR introduces a way to run code on a specific shard by method:

pub async fn submit_to<Func, Fut, Ret>(shard_id: u32, func: Func) -> Ret
where
    Func: FnOnce() -> Fut + Send + 'static,
    Fut: Future<Output = Ret> + 'static,
    Ret: Send + 'static,

For example:

let _ = submit_to(0, || async { 42 }).await;
piodul commented 1 year ago

(needs rebase, by the way)

piodul commented 1 year ago

Please rebase, again - there was an issue with the CI which has been fixed (https://github.com/zpp-2022-rust-seastar/seastar-rs/pull/36)

grzenow4 commented 1 year ago

Done.