count_once

package module
v0.0.0-...-1e27944 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 2 Imported by: 0

README

countOnce

just once? no, when appear many it run once, but it can run many times

灵感来源

参考sync.once 只能发生一次,此包提供了并发时发生一次,多次调用仍有效

code start
queueMutex = utils.NewQueueMutex()
queueMutex.Do(func() {
  do something...
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QueueMutex

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

func NewQueueMutex

func NewQueueMutex() *QueueMutex

func (*QueueMutex) Do

func (m *QueueMutex) Do(f func())

并发时单次执行f函数

Jump to

Keyboard shortcuts

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