Documentation
¶
Index ¶
- func NextId() uintptr
- type BaseScheduler
- type BaseSchedulerEntry
- type Delayed
- type Dispatcher
- func (d *Dispatcher[T]) Dispatch(sender Telegraph[T], receiver Telegraph[T], message T, ...)
- func (d *Dispatcher[T]) HandleMessage(telegram Telegram[T]) bool
- func (hi *Dispatcher) Identity() uintptr
- func (d *Dispatcher[T]) Listeners() Registry[reflect.Type, Telegraph[T]]
- func (d *Dispatcher[T]) Providers() Registry[reflect.Type, TelegramProvider[T]]
- type LoadBalancingScheduler
- type PriorityScheduler
- type PrioritySchedulerEntry
- type Registry
- type ReturnReceipt
- type Schedulable
- type Scheduler
- type SchedulerEntry
- type SimpleRegistry
- func (r *SimpleRegistry[K, O]) Add(id uintptr, obj O, key K)
- func (r *SimpleRegistry[K, O]) Clear(key K)
- func (r *SimpleRegistry[K, O]) ClearAll()
- func (r *SimpleRegistry[K, O]) Get(key K) map[uintptr]O
- func (r *SimpleRegistry[K, O]) Remove(id uintptr, key K)
- func (r *SimpleRegistry[K, O]) RemoveAll(id uintptr)
- type State
- type StateMachine
- func (sm *StateMachine[E, T]) Change(ns State[E, T])
- func (sm *StateMachine[E, T]) Current() bt.Optional[State[E, T]]
- func (sm *StateMachine[E, T]) Global() bt.Optional[State[E, T]]
- func (sm *StateMachine[E, T]) HandleMessage(telegram Telegram[T]) bool
- func (hi *StateMachine) Identity() uintptr
- func (sm *StateMachine[E, T]) IsIn(state State[E, T]) bool
- func (sm *StateMachine[E, T]) Owner() bt.Optional[E]
- func (sm *StateMachine[E, T]) Previous() bt.Optional[State[E, T]]
- func (sm *StateMachine[E, T]) Revert() bool
- func (sm *StateMachine[E, T]) Update()
- type Telegram
- type TelegramProvider
- type Telegraph
- type TypeRegistry
- func (r *TypeRegistry[O]) Add(id uintptr, obj O, key reflect.Type)
- func (r *TypeRegistry[O]) Clear(key reflect.Type)
- func (r *TypeRegistry[O]) ClearAll()
- func (r *TypeRegistry[O]) Get(key reflect.Type) map[uintptr]O
- func (r *TypeRegistry[O]) Remove(id uintptr, key reflect.Type)
- func (r *TypeRegistry[O]) RemoveAll(id uintptr)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseScheduler ¶
type BaseScheduler[T SchedulerEntry] struct { // contains filtered or unexported fields }
type BaseSchedulerEntry ¶
type BaseSchedulerEntry struct {
// contains filtered or unexported fields
}
func (BaseSchedulerEntry) Frequency ¶
func (b BaseSchedulerEntry) Frequency() int
func (BaseSchedulerEntry) Phase ¶
func (b BaseSchedulerEntry) Phase() int
func (BaseSchedulerEntry) Schedulable ¶
func (b BaseSchedulerEntry) Schedulable() Schedulable
type Dispatcher ¶
type Dispatcher[T any] struct { // contains filtered or unexported fields }
func NewDispatcher ¶
func NewDispatcher[T any]() *Dispatcher[T]
func (*Dispatcher[T]) HandleMessage ¶
func (d *Dispatcher[T]) HandleMessage(telegram Telegram[T]) bool
func (*Dispatcher[T]) Listeners ¶
func (d *Dispatcher[T]) Listeners() Registry[reflect.Type, Telegraph[T]]
func (*Dispatcher[T]) Providers ¶
func (d *Dispatcher[T]) Providers() Registry[reflect.Type, TelegramProvider[T]]
type LoadBalancingScheduler ¶
type LoadBalancingScheduler struct { BaseScheduler[BaseSchedulerEntry] }
func (*LoadBalancingScheduler) Add ¶
func (sch *LoadBalancingScheduler) Add(schedulable Schedulable, frequency int, phase bt.Optional[int])
func (*LoadBalancingScheduler) Run ¶
func (sch *LoadBalancingScheduler) Run(ttl float32)
type PriorityScheduler ¶
type PriorityScheduler struct { BaseScheduler[PrioritySchedulerEntry] }
func (*PriorityScheduler) Add ¶
func (sch *PriorityScheduler) Add(schedulable Schedulable, frequency int, phase bt.Optional[int])
func (*PriorityScheduler) AddPriority ¶
func (sch *PriorityScheduler) AddPriority(schedulable Schedulable, priority float32, frequency int, phase bt.Optional[int])
func (*PriorityScheduler) Run ¶
func (sch *PriorityScheduler) Run(ttl float32)
type PrioritySchedulerEntry ¶
type PrioritySchedulerEntry struct { BaseSchedulerEntry // contains filtered or unexported fields }
type ReturnReceipt ¶
type ReturnReceipt[T any] struct { // contains filtered or unexported fields }
type Schedulable ¶
type Schedulable interface {
Run(ttl float32)
}
type Scheduler ¶
type Scheduler interface { Schedulable Add(schedulable Schedulable, frequency int, phase bt.Optional[int]) }
type SchedulerEntry ¶
type SchedulerEntry interface { Schedulable() Schedulable Frequency() int Phase() int }
type SimpleRegistry ¶
type SimpleRegistry[K comparable, O any] struct { // contains filtered or unexported fields }
func NewSimpleRegistry ¶
func NewSimpleRegistry[K, O comparable](addCallback func(O, K)) *SimpleRegistry[K, O]
func (*SimpleRegistry[K, O]) Add ¶
func (r *SimpleRegistry[K, O]) Add(id uintptr, obj O, key K)
func (*SimpleRegistry[K, O]) Clear ¶
func (r *SimpleRegistry[K, O]) Clear(key K)
func (*SimpleRegistry[K, O]) ClearAll ¶
func (r *SimpleRegistry[K, O]) ClearAll()
func (*SimpleRegistry[K, O]) Get ¶
func (r *SimpleRegistry[K, O]) Get(key K) map[uintptr]O
func (*SimpleRegistry[K, O]) Remove ¶
func (r *SimpleRegistry[K, O]) Remove(id uintptr, key K)
func (*SimpleRegistry[K, O]) RemoveAll ¶
func (r *SimpleRegistry[K, O]) RemoveAll(id uintptr)
type StateMachine ¶
type StateMachine[E, T any] struct { // contains filtered or unexported fields }
func NewStateMachine ¶
func (*StateMachine[E, T]) Change ¶
func (sm *StateMachine[E, T]) Change(ns State[E, T])
func (*StateMachine[E, T]) Current ¶
func (sm *StateMachine[E, T]) Current() bt.Optional[State[E, T]]
func (*StateMachine[E, T]) HandleMessage ¶
func (sm *StateMachine[E, T]) HandleMessage(telegram Telegram[T]) bool
func (*StateMachine[E, T]) IsIn ¶
func (sm *StateMachine[E, T]) IsIn(state State[E, T]) bool
func (*StateMachine[E, T]) Owner ¶
func (sm *StateMachine[E, T]) Owner() bt.Optional[E]
func (*StateMachine[E, T]) Previous ¶
func (sm *StateMachine[E, T]) Previous() bt.Optional[State[E, T]]
func (*StateMachine[E, T]) Revert ¶
func (sm *StateMachine[E, T]) Revert() bool
func (*StateMachine[E, T]) Update ¶
func (sm *StateMachine[E, T]) Update()
type TelegramProvider ¶
type TypeRegistry ¶
type TypeRegistry[O any] struct { // contains filtered or unexported fields }
func NewTypeRegistry ¶
func NewTypeRegistry[O any](addCallback func(O, reflect.Type)) *TypeRegistry[O]
func (*TypeRegistry[O]) Clear ¶
func (r *TypeRegistry[O]) Clear(key reflect.Type)
func (*TypeRegistry[O]) ClearAll ¶
func (r *TypeRegistry[O]) ClearAll()
func (*TypeRegistry[O]) RemoveAll ¶
func (r *TypeRegistry[O]) RemoveAll(id uintptr)
Click to show internal directories.
Click to hide internal directories.