Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConstSource ¶
type ConstSource[T any] struct { // contains filtered or unexported fields }
ConstSource always returns the same value.
func NewConstSource ¶
func NewConstSource[T any](clk clock.Clock, value T) *ConstSource[T]
NewConstSource creates a source that always returns the given value.
func (*ConstSource[T]) Subscribe ¶
func (s *ConstSource[T]) Subscribe() <-chan T
Subscribe returns a channel that receives constant values on each clock tick.
type Publisher ¶
type Publisher[T any] interface { Subscribe() <-chan T }
Publisher provides a subscription interface for typed values.
type RandomIntSource ¶
type RandomIntSource struct {
// contains filtered or unexported fields
}
RandomIntSource generates random integers within a range [min, max].
func NewRandomIntSource ¶
func NewRandomIntSource(clk clock.Clock, min, max int) *RandomIntSource
NewRandomIntSource creates a source that generates random integers in the inclusive range [min, max].
func (*RandomIntSource) Subscribe ¶
func (s *RandomIntSource) Subscribe() <-chan int
Subscribe returns a channel that receives random integers on each clock tick.
Click to show internal directories.
Click to hide internal directories.