Documentation ¶
Overview ¶
Package goer manages a large number of virtual threads
Index ¶
- func FormatD(d time.Duration) (s string)
- func Hostname() (hostname string)
- func MemoryLinux() (byts uint64)
- func MemoryMacOS() (byts uint64)
- func MemorySize() (bytes uint64)
- func MemorySizeString() (s string)
- func TsOut(T0 time.Time) (fn func(format string, a ...interface{}))
- type ClosingTicker
- type DataPoint
- type Goer
- type GoerMax
- type GoerStat
- type LaunchData
- type Status
- type ThreadUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MemoryLinux ¶ added in v0.0.6
func MemoryLinux() (byts uint64)
func MemoryMacOS ¶ added in v0.0.6
func MemoryMacOS() (byts uint64)
func MemorySize ¶ added in v0.0.6
func MemorySize() (bytes uint64)
func MemorySizeString ¶ added in v0.0.6
func MemorySizeString() (s string)
Types ¶
type ClosingTicker ¶
type ClosingTicker struct { C <-chan time.Time MaxDuration time.Duration // atomic int64 error116.ParlError // panic in Shutdown or panic in tick thread // contains filtered or unexported fields }
ClosingTicker is like time.Ticker but the channel C closes on shutdown. A closing channel is detectable by listening threads. If the computer is busy swapping, ticks will be lost. MaxDuration indicates the longest time observed between ticks. MaxDuration is normally 1 s
func NewClosingTicker ¶
func NewClosingTicker(d time.Duration) (t *ClosingTicker)
NewClosingTicker returns a Ticker whose channel C closes on shutdown. A closing channel is detectable by a listening thread.
func (*ClosingTicker) GetError ¶ added in v0.0.6
func (t *ClosingTicker) GetError() (maxDuration time.Duration, err error)
func (*ClosingTicker) Shutdown ¶
func (t *ClosingTicker) Shutdown()
Shutdown causes the channel C to close and resources to be released
type DataPoint ¶ added in v0.0.6
func NewDataPoint ¶ added in v0.0.6
type Goer ¶
type Goer struct { T0 time.Time Number uint64 StatusThreadCount int error116.ParlError // contains filtered or unexported fields }
Goer manages threads
func NewGoer ¶
func NewGoer(threadCount uint64, tickPeriod time.Duration, fn func(goData *LaunchData), errCh chan<- error) (goer *Goer)
NewGoer launches a group of managed threads
func (*Goer) Shutdown ¶
func (goer *Goer) Shutdown()
Shutdown shuts down all managed threads and the Goer instance
func (*Goer) WaitLaunch ¶
func (goer *Goer) WaitLaunch()
WaitLaunch wait untiul all threads have been launched
type GoerStat ¶
type GoerStat struct { T time.Duration ReceivedTicks uint64 Launched uint64 Started uint64 Exited uint64 Panic uint64 Err error }
GoerStats contains the current execution state of managed threads
func (*GoerStat) DiffString ¶ added in v0.0.6
func (*GoerStat) StringState ¶ added in v0.0.6
type LaunchData ¶
type LaunchData struct { T0 time.Time ThreadID uint64 Input <-chan time.Time Output chan<- time.Time Status chan<- *ThreadUpdate }
LaunchData is what a thread receives as launch parameter