pool

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PoolWrapper

func PoolWrapper[T, In, Out any](generator Generator[T], fn func(T, In) Out) func(In) Out

PoolWrapper is a generic wrapper over some function that requires a resource pool. Pooling is encapsulated in this function.

func PoolWrapperErr

func PoolWrapperErr[T, In any](generator Generator[T], fn func(T, In) error) func(In) error

PoolWrapperErr is a generic wrapper over some function that requires a resource pool, the function is expected to return error only.

func PoolWrapperWithErr

func PoolWrapperWithErr[T, In, Out any](generator Generator[T], fn func(T, In) (Out, error)) func(In) (Out, error)

PoolWrapperWithErr is a generic wrapper over some function that requires a resource pool, and returns error in addition to some output

Types

type Generator

type Generator[T any] func() T

Generator is a constructor function of some resource

Jump to

Keyboard shortcuts

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