Go to file
Akhil Velagapudi 1b1cdc8c92 fix benchmark 2020-04-25 20:21:22 -07:00
.github/workflows Add Github Actions CI 2020-04-25 21:41:59 +02:00
benches fix benchmark 2020-04-25 20:21:22 -07:00
examples fix clippy lints 2020-04-24 11:19:25 -07:00
src More docs 2020-04-25 23:19:52 +02:00
.gitignore Lots of changes 2020-04-21 17:51:24 +02:00
Cargo.toml blocking bench 2020-04-25 20:14:18 -07:00
LICENSE-APACHE
LICENSE-MIT
README.md More docs 2020-04-25 23:19:52 +02:00
certificate.pem Add certificate 2020-03-29 17:59:43 +02:00
identity.pfx Add certificate 2020-03-29 17:59:43 +02:00

README.md

smol

Build Status License Cargo Documentation chat

A small and fast async runtime for Rust.

This runtime extends the standard library with async combinators and is only 1500 lines of code long.

Reading the docs or looking at the examples is a good way of starting to learn async Rust.

Async I/O is implemented using epoll on Linux/Android, kqueue on macOS/iOS/BSD, and wepoll on Windows.

Features

  • Async TCP, UDP, Unix domain sockets, and custom file descriptors.
  • Thread-local executor for !Send futures.
  • Work-stealing executor that adapts to uneven workloads.
  • Blocking executor for files, processes, and standard I/O.
  • Tasks that support cancelation.
  • Userspace timers.

Compatibility

This runtime is compatible with async-std and tokio.

There is an optional feature for seamless integration with crates depending on tokio. It creates a global tokio runtime and sets up its context inside smol. Enable the feature as follows:

[dependencies]
smol = { version = "1", features = ["tokio02"] }

Documentation

You can read the docs here, or generate them on your own.

If you'd like to explore the implementation in more depth, the following command generates docs for the whole crate, including private modules:

cargo doc --document-private-items --no-deps --open

Other crates

My personal crate recommendation list:

TLS certificate

Some code examples are using TLS for authentication.

To access HTTPS servers from your browser, you'll first need to import the certificate from this repository (Chrome/Firefox):

  1. Open browser settings and go to the certificate Authorities list.
  2. Click Import and select certificate.pem.
  3. Enable Trust this CA to identify websites and click OK.
  4. Restart the browser (yes, you have to!) and go to https://127.0.0.1:8001

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

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.