zcsync

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Caller

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

Caller zcsync调用者

func NewCaller

func NewCaller() *Caller

NewCaller 初始化一个zcsync调用者

func (*Caller) CallSync

func (z *Caller) CallSync(f func() error) error

CallSync 利用chan实现同步调用, 保证并发时只有一个goroutine能够执行目标函数, 其他goroutine被阻塞, 直到上一个goroutine执行完毕, 才能继续执行。

Jump to

Keyboard shortcuts

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