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
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 创建服务池
Click to show internal directories.
Click to hide internal directories.