etcd: github.com/etcd-io/etcd/pkg/wait Index | Files

package wait

import "github.com/etcd-io/etcd/pkg/wait"

Package wait provides utility functions for polling, listening using Go channel.

Index

Package Files

wait.go wait_time.go

func NewTimeList Uses

func NewTimeList() *timeList

type Wait Uses

type Wait 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(id uint64) <-chan interface{}
    // Trigger triggers the waiting chans with the given ID.
    Trigger(id uint64, x interface{})
    IsRegistered(id uint64) bool
}

Wait is an interface that provides the ability to wait and trigger events that are associated with IDs.

func New Uses

func New() Wait

New creates a Wait.

func NewWithResponse Uses

func NewWithResponse(ch <-chan interface{}) Wait

type WaitTime Uses

type WaitTime interface {
    // Wait returns a chan that waits on the given logical deadline.
    // The chan will be triggered when Trigger is called with a
    // deadline that is later than the one it is waiting for.
    Wait(deadline uint64) <-chan struct{}
    // Trigger triggers all the waiting chans with an earlier logical deadline.
    Trigger(deadline uint64)
}

Package wait imports 2 packages (graph). Updated 2018-08-28. Refresh now. Tools for package owners.