Code Explainers

Code explainers tagged #graceful-shutdown

rust
use std::sync::{mpsc, Arc, Mutex};
use std::thread;
use std::time::Duration;
 

Building a thread pool in Rust

concurrency channels thread-pool
Advanced 9 steps
go
package main
 
import (
	"context"

Graceful HTTP shutdown in Go

graceful-shutdown signals goroutines
Intermediate 8 steps
rust
use std::time::Duration;
 
use axum::{routing::get, Router};
use tokio::net::TcpListener;

Graceful shutdown in an Axum server

graceful-shutdown signal-handling async
Intermediate 8 steps
go
package worker
 
import (
	"fmt"

A graceful worker pool in Go

concurrency goroutines channels
Intermediate 7 steps
rust
use std::sync::mpsc;
use std::thread;
use std::time::Duration;
 

A worker thread driven by Rust channels

concurrency message-passing channels
Intermediate 8 steps