Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pulsar ¶
Pulsar is a pulsating object that generates pulses at the configured time intervals. It can be used under any piece of code that needs to periodically execute. We can use it in the followinig way:
p := pulsar.NewPulsar(1, time.Second) // pulse every 1 second for pulse := range p.Pulsate() { fmt.Println("received a pluse", pulse) }
func NewPulsar ¶
NewPulsar creates a new Pulsar object and returns a pointer to it. Takes the following args:
period int: time period for the pulses timeUnit time.Duration: the unit eg. time.MilliSecond time.Second etc.
Click to show internal directories.
Click to hide internal directories.