sync

package
v2.679.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package sync wires the shared buffer pool used by go-service.

This package now has a narrow scope: it does not re-export mutexes, maps, or buffer pool types. Code that needs synchronization primitives or concurrency-safe containers should import the standard library sync package or github.com/alexfalkowski/go-sync directly.

Dependency injection (Fx)

Module registers github.com/alexfalkowski/go-sync.NewBufferPool with the Fx graph so packages can share a single github.com/alexfalkowski/go-sync.BufferPool instance.

This shared pool is consumed by allocation-sensitive helpers such as cache encoding and HTTP request/response helpers.

When to import this package

Import this package when composing go-service Fx modules and you want the standard buffer pool wiring.

The standard module.Library, module.Server, and module.Client bundles already include Module through their shared library wiring. Applications using those bundles should not add Module separately.

If you need the concrete pool type or other synchronization helpers, import github.com/alexfalkowski/go-sync directly.

Index

Constants

This section is empty.

Variables

Module wires the upstream go-sync buffer pool into go.uber.org/fx.

Including this module in an Fx application provides a single shared buffer pool dependency, github.com/alexfalkowski/go-sync.BufferPool, constructed via github.com/alexfalkowski/go-sync.NewBufferPool.

This is commonly used to reduce allocations across components that build or transform byte payloads, such as encoders, compressors, caches, and HTTP helpers.

Module only provides the buffer pool. It does not register lifecycle hooks, configure the pool, or re-export other upstream synchronization helpers.

Standard go-service module bundles already include this module through their shared library wiring, so custom compositions should include it only when they are not already using one of those bundles.

The provided type and its lifecycle/usage contract are defined by the upstream github.com/alexfalkowski/go-sync package.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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