eventGroup

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

* * @Author: TheLife * @Date: 2020-3-19 2:01 上午

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

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

func (*Event) IsRegistered

func (w *Event) IsRegistered(id uint64) bool

判断该id是否被注册

func (*Event) Register

func (w *Event) Register(timeout time.Duration, count int, data interface{}, callbackFunc func(data interface{})) (id uint64)

注册

func (*Event) Trigger

func (w *Event) Trigger(id uint64)

触发

type WaitGroup

type WaitGroup interface {
	// Register waits returns a chan that waits on the given ID.
	// The chan will be triggered when Trigger is called with
	// the same ID.
	Register(timeout time.Duration, count int, data interface{}, callbackFunc func(data interface{})) (id uint64)
	// Trigger triggers the waiting chans with the given ID.
	Trigger(id uint64)
	IsRegistered(id uint64) bool
}

func NewEventGroup

func NewEventGroup() WaitGroup

Jump to

Keyboard shortcuts

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