Documentation ¶
Overview ¶
Package utils contains helper functions and structs used by dragonboat's examples.
Index ¶
- func GetUINT16(buf []byte) (n uint16)
- func GetUINT32(buf []byte) (n uint32)
- func GetUINT40(buf []byte) uint64
- func GetUINT64(buf []byte) (n uint64)
- func Max(x uint64, y uint64) uint64
- func Min(x uint64, y uint64) uint64
- func Min32(x uint32, y uint32) uint32
- func PutUINT16(buf []byte, n uint16)
- func PutUINT32(buf []byte, n uint32)
- func PutUINT40(buf []byte, val uint64)
- func PutUINT64(buf []byte, n uint64)
- type Stopper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Stopper ¶
type Stopper struct {
// contains filtered or unexported fields
}
Stopper is a manager struct for managing worker goroutines.
func (*Stopper) Close ¶
func (s *Stopper) Close()
Close closes the internal shouldStopc chan struct{} to signal all worker goroutines that they should stop.
func (*Stopper) RunWorker ¶
func (s *Stopper) RunWorker(f func())
RunWorker creates a new goroutine and invoke the f func in that new worker goroutine.
func (*Stopper) ShouldStop ¶
func (s *Stopper) ShouldStop() chan struct{}
ShouldStop returns a chan struct{} used for indicating whether the Stop() function has been called on Stopper.
Click to show internal directories.
Click to hide internal directories.