smol/README.md

95 lines
3.3 KiB
Markdown
Raw Normal View History

2020-04-16 14:09:22 +00:00
# smol
A small and fast async runtime.
2020-04-20 16:12:26 +00:00
https://discord.gg/5RxMVnr
2020-02-06 14:09:00 +00:00
## Goals
2020-02-04 14:08:34 +00:00
2020-04-20 16:13:28 +00:00
* Small - Around 1500 lines of code.
2020-02-05 18:54:55 +00:00
* Fast - On par with async-std and Tokio.
2020-02-06 19:56:20 +00:00
* Safe - Written in 100% safe Rust.
* Complete - Fully featured and ready for production.
2020-02-07 10:54:50 +00:00
* Documented - Simple code, easy to understand and modify.
2020-04-19 09:29:52 +00:00
* Lightweight - Small dependencies, relies on epoll/kqueue/wepoll.
2020-03-05 00:08:44 +00:00
* Portable - Linux, Android, macOS, iOS, Windows, FreeBSD, OpenBSD, NetBSD, DragonFly BSD.
2020-02-06 14:09:00 +00:00
## Features
2020-02-10 19:10:43 +00:00
* Executor - Configurable threads, work stealing, supports non-send futures.
2020-02-04 13:11:12 +00:00
* Blocking - Thread pool for isolating blocking code.
2020-02-06 14:09:00 +00:00
* Networking - TCP, UDP, Unix domain sockets, and custom files/sockets.
2020-02-06 19:56:20 +00:00
* Process - Spawns child processes and interacts with their I/O.
2020-02-10 19:10:43 +00:00
* Files - Filesystem manipulation operations.
* Stdio - Asynchronous stdin, stdout, and stderr.
2020-02-04 13:11:12 +00:00
* Timer - Efficient userspace timers.
2020-02-04 10:27:09 +00:00
2020-04-20 16:12:26 +00:00
# Documentation
```
cargo doc --document-private-items --no-deps --open
```
2020-04-20 15:45:14 +00:00
# TODO Crate recommendations
# TODO certificate and private key
```
// To access the HTTPS version, import the certificate into Chrome/Firefox:
// 1. Open 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 and go to https://127.0.0.1:8001
//
// The certificate was generated using minica and openssl:
// 1. minica --domains localhost -ip-addresses 127.0.0.1 -ca-cert certificate.pem
// 2. openssl pkcs12 -export -out identity.pfx -inkey localhost/key.pem -in localhost/cert.pem
```
2020-04-16 15:16:03 +00:00
## Examples
2020-02-07 17:44:15 +00:00
2020-04-16 15:16:03 +00:00
* [Async-h1 client](./examples/async-h1-client.rs)
* [Async-h1 server](./examples/async-h1-server.rs)
* [Chat Client](./examples/chat-client.rs)
* [Chat Server](./examples/chat-server.rs)
* [Compat reqwest](./examples/compat-reqwest.rs)
* [Compat tokio](./examples/compat-tokio.rs)
* [Ctrl-c](./examples/ctrl-c.rs)
* [Hyper Client](./examples/hyper-client.rs)
* [Hyper Server](./examples/hyper-server.rs)
* [Linux Inotify](./examples/linux-inotify.rs)
* [Linux Timefd](./examples/linux-timerfd.rs)
* [Process Output](./examples/process-output.rs)
* [Process Run](./examples/process-run.rs)
* [Read Dir](./examples/read-dir.rs)
* [Read File](./examples/read-file.rs)
* [Simple Client](./examples/simple-client.rs)
* [Simple Server](./examples/simple-server.rs)
* [Stdin to Stdout](./examples/stdin-to-stdout.rs)
* [Tcp Client](./examples/tcp-client.rs)
* [Tcp Server](./examples/tcp-server.rs)
* [Thread Pool](./examples/thread-pool.rs)
* [Timer Sleep](./examples/timer-sleep.rs)
* [Timer Timeout](./examples/timer-timeout.rs)
* [TLS Client](./examples/tls-client.rs)
* [TLS Server](./examples/tls-server.rs)
* [Unix Signal](./examples/unix-signal.rs)
* [Web Crawler](./examples/web-crawler.rs)
* [Websocket Client](./examples/websocket-client.rs)
* [WebSocket Server](./examples/websocket-server.rs)
* [Windows Uds](./examples/windows-uds.rs)
2020-02-07 17:44:15 +00:00
2020-02-04 10:27:09 +00:00
## License
<sup>
Licensed under either of <a href="LICENSE-APACHE">Apache License, Version
2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option.
</sup>
<br/>
<sub>
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
</sub>