I’ve worked on a handful of projects over the past years. As SourceHut and GitHub’s project discovery mechanisms are poor, I’ve decided to list them here, in order of relative importance.
smol
smol
is a small and fast async
runtime for Rust.
It is designed to be easily compartmentalized, efficient and simple. A user with intermediate Rust programming experience should be able to understand the components of the runtime and how they interact with each other.
I am not the original author of smol
; however, I am one of its primary maintainers. smol
is composed of many smaller crates.
async-io
is a reactor for asynchronous I/O primitives. It wraps around socket types (likeTcpStream
andUnixStream
) and provides a unified interface for asynchronous I/O. It usespolling
to poll for I/O events and converts them into a futures-based API.blocking
is a thread-pool that can transform blocking functions into asynchronous functions. This thread pool is flexible and only uses the number of threads that are needed. It can also turnRead
,Write
andIterator
types into asynchronousAsyncRead
,AsyncWrite
andStream
that uses this thread pool.futures-lite
is a lightweight set of combinators for futures,Stream
s and asynchronous I/O.async-task
provides a way to associate some state with a future such that it can be polled in a separate executor, while aTask
handle is still held by the user. It is highly efficient, only uses a single allocation and has zero dependencies.async-executor
is the reference implementation of theasync
hronous executor built onasync-task
. It supports multi-threaded execution, and is used bysmol
to execute tasks.async-channel
is an MPMC asynchronous channel that supports sending data between tasks.async-lock
is an implementation of locking primitives that can beawait
ed on.async-fs
is anasync
implementation ofstd::fs
. It usesblocking
to handle file system operations in anasync
way.async-net
is anasync
implementation of thestd::net
module. It providesTcpStream
,TcpListener
,UdpSocket
andUnixStream
types. It usesasync-io
for asynchronous I/O andblocking
for DNS lookups.async-process
is anasync
wrapper aroundstd::process
. It listens for SIGCHLD in order to wait for inner process events in anasync
way.async-io
is used for asynchronous I/O on pipes in Unix, andblocking
is used on Windows.async-signal
allows for asynchronous signal waiting. It is used inasync-process
to wait for the SIGCHLD signal.concurrent-queue
is a lock-free MPMC queue. It is used to implement channels, task queues and other primitives.event-listener
is a fundamental building block for asynchronous primitives. Essentially, it allows non-blocking data structures to be transformed into asynchronous data structures, by having it wait for events to happen in other tasks. Under the hood it is a linked list of tasks waiting for an event to happen.fastrand
is a basic PRNG that provides good-enough randomness for many applications insmol
.parking
blocks and unblocks threads. It is a version ofstd::thread::park
without global variables and with a “signal” mechanism.piper
is a ring buffer that can send bytes between tasks. It is used to implement pipes inblocking
.polling
is a portable but featureful aroundepoll
,kqueue
, IOCP and others. It allows for cross-platform polling of I/O events.