count

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package count implements a global concurrency limiter using atomic counters (non-blocking) or a buffered channel semaphore (blocking).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(n int) limiter.Limiter

New creates a non-blocking limiter that allows at most n concurrent permits. Acquire returns limiter.ErrLimitExceeded immediately when the limit is reached.

func NewBlocking

func NewBlocking(n int) limiter.Limiter

NewBlocking creates a blocking limiter that allows at most n concurrent permits. Acquire blocks until a permit is available.

Types

This section is empty.

Jump to

Keyboard shortcuts

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