core: v2ray.com/core/common/signal Index | Files | Directories

package signal

import "v2ray.com/core/common/signal"

Index

Package Files

notifier.go timer.go

type ActivityTimer Uses

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

func CancelAfterInactivity Uses

func CancelAfterInactivity(ctx context.Context, cancel context.CancelFunc, timeout time.Duration) *ActivityTimer

func (*ActivityTimer) SetTimeout Uses

func (t *ActivityTimer) SetTimeout(timeout time.Duration)

func (*ActivityTimer) Update Uses

func (t *ActivityTimer) Update()

type ActivityUpdater Uses

type ActivityUpdater interface {
    Update()
}

type Notifier Uses

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

Notifier is a utility for notifying changes. The change producer may notify changes multiple time, and the consumer may get notified asynchronously.

func NewNotifier Uses

func NewNotifier() *Notifier

NewNotifier creates a new Notifier.

func (*Notifier) Signal Uses

func (n *Notifier) Signal()

Signal signals a change, usually by producer. This method never blocks.

func (*Notifier) Wait Uses

func (n *Notifier) Wait() <-chan struct{}

Wait returns a channel for waiting for changes. The returned channel never gets closed.

Directories

PathSynopsis
done
pubsub
semaphore

Package signal imports 5 packages (graph) and is imported by 54 packages. Updated 2019-02-15. Refresh now. Tools for package owners.