Documentation
¶
Overview ¶
Package context defines the global context object used by Netrix.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RootContext ¶
type RootContext struct {
// Config and instance of the configuration object
Config *config.Config
// EventIDGen a thread safe counter to generate event ids
EventIDGen *util.Counter
// Replicas instance of the ReplicaStore which contains information of all the replicas
Replicas *types.ReplicaStore
// MessageQueue stores the messages that are _intercepted_ as a queue
MessageQueue *types.Queue[*types.Message]
// MessageStore stores the messages that are _intercepted_ as a map
MessageStore *types.Map[types.MessageID, *types.Message]
// EventQueue stores the events sent by the replicas as a queue
EventQueue *types.Queue[*types.Event]
// Logger for logging purposes
Logger *log.Logger
// ReportStore contains a log of important events
ReportStore *types.ReportLogs
}
RootContext stores the context of the scheduler
func NewRootContext ¶
func NewRootContext(config *config.Config, logger *log.Logger) *RootContext
NewRootContext creates an instance of the RootContext from the configuration
func (*RootContext) PauseQueues ¶ added in v0.2.1
func (c *RootContext) PauseQueues()
PauseQueues invokes types.Queue.Pause on the message and event queues
func (*RootContext) ResumeQueues ¶ added in v0.2.1
func (c *RootContext) ResumeQueues()
ResumeQueues invokes types.Queue.Resume on the message and event queues
func (*RootContext) Start ¶
func (c *RootContext) Start()
Start implements Service and initializes the queues
func (*RootContext) Stop ¶
func (c *RootContext) Stop()
Stop implements Service and terminates the queues
Click to show internal directories.
Click to hide internal directories.