#channel Clear
Tags #php #kotlin #bash #go #sql #rust #typescript #html #java #python #files #utils #strings #http #concurrency #async #json #arrays #security #types #crypto #database #dates #format
Rust mpsc Channel Between Threads
`std::sync::mpsc` is the standard cross-thread channel. Multiple producers, single consumer. Send any `Send` type; the receiver blocks on `recv()` until something arrives.
Rust tokio mpsc Channel
Async multi-producer / single-consumer channel. Producers `.send()`, the single receiver `.recv().await` items as they arrive. Bounded — the channel back-pressures producers when full.
Go Empty Struct Sentinel (struct{})
`struct{}` is a zero-size value — no memory cost. Use it as the value type in a Set (`map[T]struct{}`), as a channel signal (`chan struct{}`), or as a marker type.
Go Concurrency Limit via Buffered Channel (Semaphore)
A buffered channel of size N is the simplest semaphore in Go — acquire by sending, release by receiving. Zero dependencies, no sync.Semaphore needed.