Documentation
¶
Overview ¶
Package timer provides timer implementations for Narwhal.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockTimer ¶
type MockTimer struct {
// contains filtered or unexported fields
}
MockTimer is a timer for testing that can be triggered manually.
func (*MockTimer) Fire ¶
func (t *MockTimer) Fire()
Fire triggers the timer, simulating a timeout. This is the test helper method.
type RealTimer ¶
type RealTimer struct {
// contains filtered or unexported fields
}
RealTimer implements Timer using actual time.
func NewRealTimer ¶
NewRealTimer creates a new RealTimer with the given duration.
type Timer ¶
type Timer interface {
// Start starts the timer to fire after the configured duration.
Start()
// Stop stops the timer, preventing it from firing.
Stop()
// Reset resets the timer to fire after the configured duration.
// If the timer was stopped, this starts it again.
Reset()
// C returns the channel that receives when the timer fires.
C() <-chan struct{}
}
Timer provides timeout management for batch and header creation.
Click to show internal directories.
Click to hide internal directories.