All Projects → smol-rs → Smol

smol-rs / Smol

Licence: other
A small and fast async runtime for Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Smol

Actix Net
A collection of lower-level libraries for composable network services.
Stars: ✭ 415 (-81.19%)
Mutual labels:  async, networking, runtime
Lightio
LightIO is a userland implemented green thread library for ruby
Stars: ✭ 165 (-92.52%)
Mutual labels:  async, concurrency, networking
Vibe.d
Official vibe.d development
Stars: ✭ 1,043 (-52.72%)
Mutual labels:  async, concurrency, networking
Funfix
Functional Programming Library for JavaScript, TypeScript and Flow ✨⚡️
Stars: ✭ 596 (-72.98%)
Mutual labels:  async, concurrency, futures
Async
Async utilities for Golang.
Stars: ✭ 72 (-96.74%)
Mutual labels:  async, concurrency
Tanya
GC-free, high-performance D library: Containers, networking, metaprogramming, memory management, utilities
Stars: ✭ 70 (-96.83%)
Mutual labels:  async, networking
Facil.io
Your high performance web application C framework
Stars: ✭ 1,393 (-36.85%)
Mutual labels:  concurrency, networking
Drone
CLI utility for Drone, an Embedded Operating System.
Stars: ✭ 114 (-94.83%)
Mutual labels:  async, concurrency
Uvloop
Ultra fast asyncio event loop.
Stars: ✭ 8,246 (+273.8%)
Mutual labels:  async, networking
Ws Machine
WS-Machine is a websocket finite state machine for client websocket connections (Go)
Stars: ✭ 110 (-95.01%)
Mutual labels:  async, networking
Nuclei
Proactive IO & Runtime system
Stars: ✭ 113 (-94.88%)
Mutual labels:  async, runtime
Avenue
Wrapper around URLSession and URLSessionTask to enable seamless integration with Operation / OperationQueue.
Stars: ✭ 58 (-97.37%)
Mutual labels:  async, networking
Ea Async
EA Async implements async-await methods in the JVM.
Stars: ✭ 1,085 (-50.82%)
Mutual labels:  async, concurrency
Swimmer
🏊 Swimmer - An async task pooling and throttling utility for JS
Stars: ✭ 94 (-95.74%)
Mutual labels:  async, concurrency
Asyncninja
A complete set of primitives for concurrency and reactive programming on Swift
Stars: ✭ 146 (-93.38%)
Mutual labels:  async, concurrency
Tascalate Concurrent
Implementation of blocking (IO-Bound) cancellable java.util.concurrent.CompletionStage and related extensions to java.util.concurrent.ExecutorService-s
Stars: ✭ 144 (-93.47%)
Mutual labels:  async, concurrency
Vue Concurrency
A library for encapsulating asynchronous operations and managing concurrency for Vue and Composition API.
Stars: ✭ 147 (-93.34%)
Mutual labels:  async, concurrency
Hydra
⚡️ Lightweight full-featured Promises, Async & Await Library in Swift
Stars: ✭ 1,954 (-11.42%)
Mutual labels:  async, futures
Asyncio
asyncio historical repository
Stars: ✭ 952 (-56.84%)
Mutual labels:  concurrency, networking
Futures Batch
An adapter for futures, which chunks up elements and flushes them after a timeout, or when the buffer is full. (Formerly known as tokio-batch.)
Stars: ✭ 37 (-98.32%)
Mutual labels:  async, futures

smol

Build License Cargo Documentation Chat

A small and fast async runtime.

This crate simply re-exports other smaller async crates (see the source).

To use tokio-based libraries with smol, apply the async-compat adapter to futures and I/O types.

Examples

Connect to an HTTP website, make a GET request, and pipe the response to the standard output:

use smol::{io, net, prelude::*, Unblock};

fn main() -> io::Result<()> {
    smol::block_on(async {
        let mut stream = net::TcpStream::connect("example.com:80").await?;
        let req = b"GET / HTTP/1.1\r\nHost: example.com\r\nConnection: close\r\n\r\n";
        stream.write_all(req).await?;

        let mut stdout = Unblock::new(std::io::stdout());
        io::copy(stream, &mut stdout).await?;
        Ok(())
    })
}

There's a lot more in the examples directory.

Subcrates

TLS certificate

Some code examples are using TLS for authentication. The repository contains a self-signed certificate usable for testing, but it should not be used for real-world scenarios. Browsers and tools like curl will show this certificate as insecure.

In browsers, accept the security prompt or use curl -k on the command line to bypass security warnings.

The certificate file was generated using minica and openssl:

minica --domains localhost -ip-addresses 127.0.0.1 -ca-cert certificate.pem
openssl pkcs12 -export -out identity.pfx -inkey localhost/key.pem -in localhost/cert.pem

Another useful tool for making certificates is mkcert.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].