This article is about building actors with Tokio directly, without using any
actor libraries such as Actix. This turns out to be rather easy to do, however
there are some details you should be aware of:
- Where to put the
- Struct with
run method vs bare function.
- Handles to the actor.
- Backpressure and bounded channels.
- Graceful shutdown.
The techniques outlined in this article should work with any executor, but for
simplicity we will only talk about Tokio. There is some overlap with the
spawning and channel chapters from the Tokio tutorial, and I recommend also
reading those chapters.
The async/await feature in Rust is implemented using a mechanism known as cooperative
scheduling, and this has some important consequences for people who write asynchronous
The intended audience of this blog post is new users of async Rust. I will be using the
Tokio runtime for the examples, but the points raised here apply to any asynchronous
If you remember only one thing from this article, this should be it:
Async code should never spend a long time without reaching an
The purpose of this blog post is to celebrate the anniversary of two really neat methods
Both methods were released in version 1.37.0 of Rust, exactly one year ago
from the date this post was published.
This page functions as a home page for my rust library
backblaze-b2. Here are some
links to the project:
I've created a printed circuit board (PCB) that simulates the game of life on a
5 by 5 LED grid, and can be remote controlled with Bluetooth. The project was
created in collaboration with another student as a school project. Here is a video of
the finished product:
In order to investigate the behaviour of Newton Fractals at
infinity, I've plotted Newton Fractals on the Riemann sphere. Here's an
animated video of a Newton Fractal plotted on the Riemann sphere using
YouTube's 360° video feature:
When I try to learn a new programming language, I don't write a hello world. Instead, I
write a generator of newton fractals. Here's an example of a newton fractal: