Documentation
¶
Index ¶
- Constants
- type Msg
- type Options
- type Reactor
- func (r *Reactor) CallTheInjectFunc(f func(r *Reactor))
- func (r *Reactor) End()
- func (f *Reactor) GetName() string
- func (r *Reactor) GetStatus_InsideReactorFuncOnly() (s *Status)
- func (r *Reactor) RecursiveWindUp(tracer loggeterrapi.ITracer)
- func (r *Reactor) Send(m *Msg)
- func (r *Reactor) SendStatus_Cede(otdg upcommon.IRecursiveWindUp, name string)
- func (r *Reactor) SendStatus_Fail(otdg upcommon.IRecursiveWindUp, name string)
- func (r *Reactor) SendStatus_Up(otdg upcommon.IRecursiveWindUp, name string)
- func (r *Reactor) StartFresh(of ...func(opts *Options)) *Reactor
- type Status
- type Subsystem
- type Subsystems
- type SubsystemsPattern
Constants ¶
View Source
const ( Signal_End uint8 = iota Signal_IsUp Signal_IsFailed Signal_Cede Signal_CallTheInjectFunc )
View Source
const ( Status_Undef uint8 = iota Status_Fresh Status_Up Status_Failed Status_Ceded RequiredStatus_Up RequiredStatus_UpOrCeded )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Msg ¶
type Msg struct {
Signal uint8
Name string // process node Id / OTDG name
OTDG upcommon.IRecursiveWindUp // the OTDG itself - can't use real type because of stupid Go language cycle import limitation
InjectFunc func(r *Reactor)
}
type Reactor ¶
type Reactor struct {
Name string // the name is required, since it's used in a user-side tracer when calling RecursiveWindUp()
Context context.Context
Tracer loggeterrapi.ITracer
NeedsPattern SubsystemsPattern // the required dependencies pattern, map[<dep_name>]<required_status>
Func func(r *Reactor, msg *Msg)
Func_CanReact func(r *Reactor, msg *Msg, status *Status)
Done bool
// contains filtered or unexported fields
}
func NewReactor ¶ added in v1.89.0
func (*Reactor) CallTheInjectFunc ¶ added in v1.88.0
func (*Reactor) End ¶
func (r *Reactor) End()
Prefer not to use this when reactor achieves readiness - what if some will send up signals after the reactor already achieved readiness and closed? It will panic, and that's not what you may want. Use Done flag to make sure it reacts only once.
func (*Reactor) GetStatus_InsideReactorFuncOnly ¶ added in v1.88.0
Please: use only from within the reactor func
func (*Reactor) RecursiveWindUp ¶ added in v1.88.0
func (r *Reactor) RecursiveWindUp(tracer loggeterrapi.ITracer)
Be careful if your reactor dependency graph has diamond topology (is not a DAG); In that case, better implement explicit forward action plan to wind up your system.
func (*Reactor) SendStatus_Cede ¶ added in v1.88.0
func (r *Reactor) SendStatus_Cede(otdg upcommon.IRecursiveWindUp, name string)
func (*Reactor) SendStatus_Fail ¶ added in v1.88.0
func (r *Reactor) SendStatus_Fail(otdg upcommon.IRecursiveWindUp, name string)
func (*Reactor) SendStatus_Up ¶ added in v1.88.0
func (r *Reactor) SendStatus_Up(otdg upcommon.IRecursiveWindUp, name string)
func (*Reactor) StartFresh ¶ added in v1.88.0
type Subsystem ¶ added in v1.88.0
type Subsystem struct {
Name string
Itself upcommon.IRecursiveWindUp
Status uint8
}
type Subsystems ¶ added in v1.88.0
type SubsystemsPattern ¶ added in v1.88.0
Click to show internal directories.
Click to hide internal directories.