Documentation ¶
Overview ¶
Package goer manages a large number of virtual threads
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClosingTicker ¶
type ClosingTicker struct { C <-chan time.Time error116.ParlError // contains filtered or unexported fields }
ClosingTicker is like time.Ticker but the channel C closes on shutdown. A closing channel is detectable by a listening thread
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) Shutdown ¶
func (t *ClosingTicker) Shutdown()
Shutdown causes the channel C to close and resources to be released
type Goer ¶
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 { ReceivedTicks uint64 Launched uint64 Started uint64 Exited uint64 Panic uint64 Err error }
GoerStats contains the current execution state of managed threads
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