Documentation ¶
Index ¶
- type Timer
- func (tm *Timer) ApplyEvents(ctx context.Context, eventList *events.EventList) error
- func (tm *Timer) Delay(ctx context.Context, events *events.EventList, delay types.Duration)
- func (tm *Timer) EventsOut() <-chan *events.EventList
- func (tm *Timer) GarbageCollect(retIndex tt.RetentionIndex)
- func (tm *Timer) ImplementsModule()
- func (tm *Timer) Repeat(ctx context.Context, events *events.EventList, period types.Duration, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
The Timer module abstracts the passage of real time. It is used for implementing timeouts and periodic repetition.
func (*Timer) ApplyEvents ¶
func (*Timer) Delay ¶
Delay writes events to the output channel after delay. If context is canceled, no events might be written.
func (*Timer) GarbageCollect ¶
func (tm *Timer) GarbageCollect(retIndex tt.RetentionIndex)
GarbageCollect cancels the effect of outdated calls to Repeat. When GarbageCollect is called, the Timer stops repeatedly producing events associated with a retention index smaller than retIndex. If GarbageCollect already has been invoked with the same or higher retention index, the call has no effect.
func (*Timer) ImplementsModule ¶
func (tm *Timer) ImplementsModule()
The ImplementsModule method only serves the purpose of indicating that this is a Module and must not be called.
func (*Timer) Repeat ¶
func (tm *Timer) Repeat( ctx context.Context, events *events.EventList, period types.Duration, retIndex tt.RetentionIndex, )
Repeat periodically writes events to the output channel with the given period. The repeated producing of events is associated with the retention index retIndex. The first write of events to the output channel happens immediately after invocation of Repeat. Repeat stops writing events to the output channel when 1) ctx is canceled or 2) GarbageCollect is called with an argument greater than the associated retIndex.