Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFakeAlarm ¶ added in v0.0.15
func NewFakeAlarm(chanSize int, opts ...Option) (Alarm, FakeAlarmController)
NewFakeAlarm creates a fake alarm replacement where an event is resend each time FakeAlarmController.Tick() is called.
Types ¶
type Alarm ¶
Alarm resends events at the requested time, or later. Closing the Send channel asks the alarm to terminate, which is notified by closing Receive.
type FakeAlarmController ¶ added in v0.0.15
type FakeAlarmController interface {
// Tick asks the fake alarm to send its most recent event.
Tick()
Close()
QueueLength() int
}
FakeAlarmController allows to control a fake alarm returned by NewFakeAlarm.
type Option ¶ added in v0.0.7
type Option func(evt *alarmLogic)
var ( // Events received by Alarm with Time greater than any waiting event are ignored. DiscardLaterEvent Option = func(evt *alarmLogic) { evt.discardLaterEvent = true } // Event received with same Data as any waiting event are ignored. DiscardDuplicates Option = func(evt *alarmLogic) { evt.discardDuplicates = true } // Event received with same Data and later Time than some waiting event are ignored. DiscardLateDuplicates Option = func(evt *alarmLogic) { evt.discardLateDuplicates = true } )
Click to show internal directories.
Click to hide internal directories.