patterns/

directory
v0.0.0-...-9fa2476 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: Apache-2.0

README

Concurrency Patterns

There are lots of different patterns we can create with goroutines and channels. Two interesting patterns are resource pooling and concurrent searching.

Notes

  • The work code provides a pattern for giving work to a set number of goroutines without losing the guarantee.
  • The resource pooling code provides a pattern for managing resources that goroutines may need to acquire and release.
  • The search code provides a pattern for using multiple goroutines to perform concurrent work.

Concurrency patterns
Go Concurrency Patterns: Pipelines and cancellation - Sameer Ajmani
Go Concurrency Patterns - Rob Pike
Go Concurrency Patterns: Context - Sameer Ajmani
Advanced Go Concurrency Patterns - Sameer Ajmani
Go: code that grows with grace - Andrew Gerrand

Functional Options : type DialOption func(*dialOptions)
https://github.com/grpc/grpc-go/blob/master/clientconn.go

Code Review

Chat
Logger
Task
Pooling
Kit


All material is licensed under the Apache License Version 2.0, January 2004.

Directories

Path Synopsis
This sample program demonstrates how the logger package works.
This sample program demonstrates how the logger package works.
Package chat implements a basic chat room.
Package chat implements a basic chat room.
main command
This sample program demonstrates how to create a simple chat system.
This sample program demonstrates how to create a simple chat system.
Package logger shows a pattern of using a buffer to handle log write continuity by dealing with write latencies by throwing away log data.
Package logger shows a pattern of using a buffer to handle log write continuity by dealing with write latencies by throwing away log data.
main command
This sample program demonstrates how the logger package works.
This sample program demonstrates how the logger package works.
Package pool manages a user defined set of resources.
Package pool manages a user defined set of resources.
main command
This sample program demonstrates how to use the pool package to share a simulated set of database connections.
This sample program demonstrates how to use the pool package to share a simulated set of database connections.
Package task provides a pool of goroutines to perform tasks.
Package task provides a pool of goroutines to perform tasks.
main command
This sample program demonstrates how to use the work package to use a pool of goroutines to get work done.
This sample program demonstrates how to use the work package to use a pool of goroutines to get work done.

Jump to

Keyboard shortcuts

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