Learning Async Rust with Too Many Web Servers

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • tcpproxy

    A cross-platform TCP proxy in tokio and rust (by mqudsi)

    Thanks. Perhaps I did go overboard with that disclaimer.. probably because I myself made the mistake of initially using [0] the oh-so-convenient tokio::io::copy() instead of writing my own copy method that would drop the other half of the connection when one side was closed.

    The copy_with_abort() routine is still taking the easy way out in this not-optimized-for-heavy-production-use sample because it uses a broadcast channel per connection to reactively signal that the other half of the connection should be closed (rather than timing out every x ms to see if an abort flag has been set). In the real world, I'd probably replace the join! macro with a manual event loop to be able to do the same but without creating a broadcast channel per-connection.

    (I maintain an extremely lightweight "awaitable bools" library for rust [1] that is perfect for this kind of thing (roughly equivalent to a "bounded broadcast_channel<()> of queue length 1, but each "channel" is only a single (optionally stack-allocated) byte) — but it's for event loops in synchronous code and not async executor compatible.)

    [0]: https://github.com/mqudsi/tcpproxy/commit/0164ef836a49f2f738...

    [1]: https://github.com/neosmart/rsevents

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • rsevents

    Auto- and manual-reset events for rust

    Thanks. Perhaps I did go overboard with that disclaimer.. probably because I myself made the mistake of initially using [0] the oh-so-convenient tokio::io::copy() instead of writing my own copy method that would drop the other half of the connection when one side was closed.

    The copy_with_abort() routine is still taking the easy way out in this not-optimized-for-heavy-production-use sample because it uses a broadcast channel per connection to reactively signal that the other half of the connection should be closed (rather than timing out every x ms to see if an abort flag has been set). In the real world, I'd probably replace the join! macro with a manual event loop to be able to do the same but without creating a broadcast channel per-connection.

    (I maintain an extremely lightweight "awaitable bools" library for rust [1] that is perfect for this kind of thing (roughly equivalent to a "bounded broadcast_channel<()> of queue length 1, but each "channel" is only a single (optionally stack-allocated) byte) — but it's for event loops in synchronous code and not async executor compatible.)

    [0]: https://github.com/mqudsi/tcpproxy/commit/0164ef836a49f2f738...

    [1]: https://github.com/neosmart/rsevents

  • glommio

    Glommio is a thread-per-core crate that makes writing highly parallel asynchronous applications in a thread-per-core architecture easier for rustaceans.

    I think you missed one which is based on io_uring [1].

    In my benchmarks with a slightly tweaked version it was 2x faster than Nginx and and 30x faster than Python's SimpleHttpServer.

    [1] https://github.com/DataDog/glommio/blob/master/examples/hype...

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Gazette: Cloud-native millisecond-latency streaming

    6 projects | news.ycombinator.com | 7 Aug 2024
  • Is async runtime (Tokio) overhead significant for a "real-time" video stream server?

    5 projects | /r/rust | 8 Mar 2023
  • Building a High-Performance DB Buffer Pool in Zig W\ Io_uring New Fixed-Buffers

    4 projects | news.ycombinator.com | 15 Oct 2022
  • Implementing truly safe semaphores in rust, and the cost we pay for safety

    2 projects | /r/rust | 4 Oct 2022
  • Finding the “Second Bug” in Glibc’s Condition Variable

    6 projects | news.ycombinator.com | 18 Sep 2022

Did you konow that Rust is
the 5th most popular programming language
based on number of metions?