pingpong

command
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Pingpong shows how (un-buffered) channels are used for communication and synchronization between goroutines. When pinger or ponger attempts to send a message on the channel, it will wait (block) until printer is ready to receive the message. Note that "ping" and "pong" are alternating. This is because channels act as first-in-first-out queues (https://go.dev/ref/spec).

Level: beginner Topics: concurrency, goroutines, channels

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL