# Functions
NewBaseComponent is a helper to create BaseComponent This func requires this component's name, implementation of IActor, and logger to record internal log msg Setting a logger with a same name with the component is recommended.
NewComponentHub creates and returns ComponentHub instance.
StatusToString returns a string representation of a component's status.
# Constants
RestartingStatus means a component is now restarting.
StartedStatus means a component is working.
StoppedStatus means a component is already stopped.
StoppingStatus means a component is stopping.
# Variables
No description provided by the author
# Structs
No description provided by the author
BaseComponent provides a basic implementations for IComponent interface.
ComponentHub keeps a list of registered components.
CompStatReq is an actor message; requesting component's statics When a component gets this message, then it collects infos and returns CompStatRsp to the requester.
CompStatRsp contains component's internal info, used to help debugging - Status is a string representation of a component's status - AccProcessedMsg is an accumulated number of message that this component processes - MsgQueueLen is an current number of message at this component's mailbox - MsgProcessLatency is an estimated latency to process a msg - Error is an error msg when a requester fails to get statics - Actor is a reserved field to get component's internal debug info.
# Interfaces
IActor describes functions that each components have to implement A BeforeStart func is called before a IComponent.Start func So developers can write component specific initalization codes in here A BeforeStop func is called before a IComponent.Stop func In a Receive func, component's actions is described For each type of message, developer can define a behavior If there is component specific statics or debug info are exists, than developers can get those by defining it in Statistics func.
IComponent provides a common interface for easy management and providing a communication channel between components BaseComponent struct provides general implementation of this.
No description provided by the author
ICompSyncRequester is the interface that wraps the RequestFuture method.
# Type aliases
Status represents a component's current running status.