Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Carl Lerche
    @carllerche
    (preparing for alphas)
    Jon Gjengset
    @jonhoo
    weee
    Carl Lerche
    @carllerche
    Carl Lerche
    @carllerche
    @jonhoo it is saying pin-utils is not on crates.io??
    yeah... i'm getting it now locally
    hmmm
    ah, lol
    find / replace fail
    Carl Lerche
    @carllerche
    @jonhoo alphas our btw
    Jon Gjengset
    @jonhoo
    :o
    exciting!
    Jon Gjengset
    @jonhoo
    @carllerche aww, I forgot to re-export Barrier from tokio::sync :'(
    Eliza Weisman
    @hawkw
    is there a reason that TcpStream::split was changed from taking self to &mut self in the latest alpha? It’s causing some trouble for me
    namely, i want to move half of a split TcpStream into a spawned future, and spawn requires the spawned future to have the static lifetime
    but the ReadHalf is no longer ’static
    ah, i guess the generic io::split works
    Jon Gjengset
    @jonhoo
    yeah, it's real sad -- you now need io::split
    which adds a lock around it
    Eliza Weisman
    @hawkw
    yup, figured that out :/
    Carl Lerche
    @carllerche
    @hawkw @jonhoo because when you use split(&mut) it is zero cost
    w/ async fn
    so, given the goal of pushing towards async fn, emphasis is put on TcpStream::split vs. the version that requires an ARc
    Eliza Weisman
    @hawkw
    Hm, okay
    i found the &mut version really hard to use w/ async fns
    Carl Lerche
    @carllerche
    @hawkw how so?
    Eliza Weisman
    @hawkw
    in particular, an accepted socket is never ‘static, so you can’t spawn an async fn or async block that uses half of a socket
    Carl Lerche
    @carllerche
    @hawkw hmm?
    in theory, you can use select w/ it
    Eliza Weisman
    @hawkw
    ah hm
    Carl Lerche
    @carllerche
    or join
    instead of spawn
    Eliza Weisman
    @hawkw
    that’s fair
    i guess my problem was “trying to use spawn"
    Carl Lerche
    @carllerche
    yeah
    but, in practice, you probably don't want spawn
    using split then spawn was a crutch
    Eliza Weisman
    @hawkw
    okay, i guess i have to learn some more new patterns...
    Carl Lerche
    @carllerche
    we are figuring them out
    Eliza Weisman
    @hawkw
    Yup!
    Jon Gjengset
    @jonhoo
    Quick +1 (I think): tokio-rs/tokio#1577
    Yeah, I've definitely also used it with spawn. Not sure that I can easily change the relevant code paths, but I'll see
    In particular, I think the issue I ran into was that I have some API that takes an AsyncRead and an AsyncWrite separately, and so needed to split to give it both. But since they borrow, the resulting thing can't be moved easily
    Jonathan Bastien-Filiatrault
    @jothan
    @jonhoo We really need structured concurrency / scoped tasks like rayon scoped threads to enable something like that.
    Jon Gjengset
    @jonhoo
    Yeah, I don't have a good way to provide it at the moment. I basically need something like this in async-bincode, but I'll see if I can work around it
    Also, how common is it to have something that is only AsyncRead or AsyncWrite?
    matrixbot
    @matrixbot
    Ralith a constant buffer can be AsyncRead
    Ralith QUIC streams can be one-directional in either direction
    Carl Lerche
    @carllerche
    @jothan there is no safe way to add scoped tasks afaik
    rayon scoped relies on the ability to block the thread