svrpool

package
v0.4.17 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireService added in v0.4.14

func AcquireService(key string, interval time.Duration, retryTimes int) (pool.ResourceID, string, error)

AcquireService 获取服务

func RegistryServicePool added in v0.4.14

func RegistryServicePool(group, key string)

RegistryServicePool 注册服务

func ReleaseService added in v0.4.14

func ReleaseService(key string, value pool.ResourceID)

ReleaseService 释放服务

Types

type PoolManager added in v0.4.14

type PoolManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

PoolManager 服务池管理器

func (*PoolManager) AcquireService added in v0.4.14

func (pm *PoolManager) AcquireService(key string, interval time.Duration, retryTimes int) (pool.ResourceID, string, error)

AcquireService 获取服务

func (*PoolManager) RegistryServicePool added in v0.4.14

func (pm *PoolManager) RegistryServicePool(group, key string)

RegistryServicePool 注册服务

func (*PoolManager) ReleaseService added in v0.4.14

func (pm *PoolManager) ReleaseService(key string, id pool.ResourceID)

ReleaseService 释放服务

type ServicePool

type ServicePool struct {
	// contains filtered or unexported fields
}

ServicePool 服务池

func NewServicePool

func NewServicePool(ctx context.Context, group, key string) *ServicePool

NewServicePool 创建服务池

Jump to

Keyboard shortcuts

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