0136-go-concurrency-patterns

Community

Build safer Go concurrency with proven patterns

AuthorMrJmpl3
Version1.0.0
Installs0

System Documentation

What problem does it solve?

It prevents common Go concurrency failures like goroutine leaks, deadlocks, race conditions, and unresponsive shutdowns by teaching reliable patterns for orchestrating goroutines and channel communication.

Core Features & Use Cases

  • Worker pool orchestration: Distribute jobs across a fixed number of workers and safely close result channels when work completes.
  • Fan-out/fan-in pipelines: Compose concurrent stages and merge multiple streams into one while respecting cancellation.
  • Bounded concurrency and rate limiting: Limit parallelism using semaphores to control load and protect downstream systems.
  • Graceful shutdown and cancellation: Coordinate termination with context deadlines and signal-triggered cancellation.
  • Concurrent error handling with cancellation: Use errgroup to cancel remaining work on the first failure and return consistent results.
  • Concurrent data access patterns: Use sync.Map or sharded maps to balance frequent reads with safe concurrent writes.
  • select-based timeouts and non-blocking behavior: Implement responsive waiting and avoid stalled channel operations.

Quick Start

Use the skill to design a Go worker pool with context cancellation and race-safe result collection for a task queue you need to process concurrently.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: 0136-go-concurrency-patterns
Download link: https://github.com/MrJmpl3/codex_____data_____configuration/archive/main.zip#0136-go-concurrency-patterns

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.