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
tokio::spawn
call.
- 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.
Continue Reading
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
Rust code.
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
runtime.
If you remember only one thing from this article, this should be it:
Async code should never spend a long time without reaching an .await
.
Continue Reading
The purpose of this blog post is to celebrate the anniversary of two really neat methods
on the Cell
type:
Both methods were released in version 1.37.0 of Rust, exactly one year ago
from the date this post was published.
Continue Reading
This page functions as a home page for my rust library backblaze-b2
. Here are some
links to the project:
Continue Reading
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:
Continue Reading
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:
Continue Reading
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:
Continue Reading