Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Carl Lerche
    @carllerche
    i have tried to use zulip a few times and have failed
    Stephen Carman
    @hntd187
    Now I can see what games lucio is playing at any given time muhahaha
    Lucio Franco
    @LucioFranco
    @hntd187 mostly just train sim
    Stephen Carman
    @hntd187
    Don’t lie I saw you playing squad
    Lucio Franco
    @LucioFranco
    @hntd187 hahah yeah thats what ive been playing recently
    Jonathan Bastien-Filiatrault
    @jothan
    @carllerche I just might have solved the blocking pool problem: jothan/tokio@b9fd51d
    the fix is too simple
    Sean McArthur
    @seanmonstar
    did latest nightly break #[tokio::test]?
    Carl Lerche
    @carllerche
    @seanmonstar discord ;)
    Sean McArthur
    @seanmonstar
    wait what! in one repo, they work fine, another says "E0658: procedural macros cannot expand to macro definitions"
    Sean McArthur
    @seanmonstar
    ohhhhh, that was super confusing, but found it: my test function had macro_rules! in it
    Carl Lerche
    @carllerche
    @/all another friendly reminder, we have moved to: https://discord.gg/6yGkFeN :)
    (if you have already moved and are tired of the pings, i would recommend leaving the dev room. The main users tokio room is still active.
    Petrov Sergey
    @petrovsa
    Hello, where can I to translate documentation of Tokio to Russion?
    Carl Lerche
    @carllerche
    @petrovsa can you ping me in discord? https://discord.gg/tokio we can coordinate there.
    matrixbot
    @matrixbot
    xionbox Hi there. I'm using tokio and tonic in a gRPC application. If I try to split up the defined services in different files, the compiler seems to get lost, claiming that my struct does not implement the only trait it actually implements
    xionbox Any idea why that would happen?
    matrixbot
    @matrixbot
    xionbox Regardless, I now have another problem whereby I cannot seem to return some streaming data
    xionbox error[E0277]: the trait bound `std::result::Result<(), std::sync::mpsc::SendError<std::result::Result<xb::ephem_registry::State, _>>>: std::future::Future` is not satisfied --> src/traj_srv/srv.rs:470:37 | 470 | ... tx.send(Ok(xb_state.clone())).await.unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `std::result::Result<(), std::sync::mpsc::SendError<std::result::Result<xb::ephem_registry::State, _>>>`
    xionbox The exact line is tx.send(Ok(xb_state)).await.unwrap(); where xb_state is a struct also generated from prost
    xionbox Any idea what the problem could be?
    xionbox I created the channel with let (mut tx, rx) = mpsc::channel();
    matrixbot
    @matrixbot
    xionbox And the function returns a Result<Response<TrajStatesStream>, Status> where type TrajStatesStream = mpsc::Receiver<Result<XbState, Status>>;
    xionbox And XbState is generated from prost
    Lucio Franco
    @LucioFranco
    you can just drop the await
    matrixbot
    @matrixbot
    xionbox Oh yeah that worked, thanks!
    matrixbot
    @matrixbot
    xionbox Right, actually, another problem I had is that I saw mpsc in the example and assumed it was from std::sync but in fact it's from tokio::sync
    xionbox Works now
    matrixbot
    @matrixbot
    xionbox Any idea how I can solve the following problem:
    `` error[E0599]: no method namednextfound for typestd::pin::Pin<&mut tonic::codec::decode::Streaming<thalassa_pb::TrajState>>in the current scope --> src/traj_srv/srv.rs:500:45 | 500 | while let Some(traj_state) = stream.next().await { | ^^^^ method not found instd::pin::Pin<&mut tonic::codec::decode::Streaming<thalassa_pb::TrajState>>| = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add ause` for it:
    |
    11 | use futures_util::stream::StreamExt;
    |
    xionbox I am using use futures_util::stream::StreamExt;
    xionbox In fact it's on the line right below what rustc recommends ...
    matrixbot
    @matrixbot
    dominic_ Hi I made this PR but i can not fint why the test is failing. tokio-rs/tokio#2079
    dominic_ Because of bad formatting but I ran cargo fmt everywhere
    Carl Lerche
    @carllerche
    cargo fmt is buggy
    matrixbot
    @matrixbot
    dominic_ So how can I fix it ?
    Carl Lerche
    @carllerche
    run that command
    matrixbot
    @matrixbot
    dominic_ ok
    dominic_ posted an image: image.png
    matrixbot
    @matrixbot
    dominic_ is this because copy.rs needs a new line at EOF ?
    dominic_ * is it because copy.rs needs a new line at EOF ?
    Carl Lerche
    @carllerche
    maybe
    i have not looked
    running the command will fix i think
    rustfmt --edition 2018 $(find . -name '*.rs' -print)
    matrixbot
    @matrixbot
    dominic_ ok that fixed it I guess
    dominic_ ci will tell me
    matrixbot
    @matrixbot
    dominic_ thx Carl Lerche (Gitter)
    dominic_ ci passed it now