Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WorkerStatusTopic ¶
func WorkerStatusTopic(masterID frameModel.MasterID) string
WorkerStatusTopic returns the p2p topic for worker status subscription of a given master.
Types ¶
type WorkerStatusMessage ¶
type WorkerStatusMessage struct { Worker frameModel.WorkerID `json:"worker"` MasterEpoch frameModel.Epoch `json:"master-epoch"` Status *frameModel.WorkerStatus `json:"status"` }
WorkerStatusMessage contains necessary fileds of a worker status message
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is used to persist WorkerStatus changes and send notifications to the Master.
func NewWriter ¶
func NewWriter( metaclient pkgOrm.Client, messageSender p2p.MessageSender, masterInfo worker.MasterInfoProvider, workerID frameModel.WorkerID, ) *Writer
NewWriter creates a new Writer.
func (*Writer) UpdateStatus ¶
func (w *Writer) UpdateStatus(ctx context.Context, newStatus *frameModel.WorkerStatus) (retErr error)
UpdateStatus checks if newStatus.HasSignificantChange() is true, if so, it persists the change and tries to send a notification. Note that sending the notification is asynchronous.
Click to show internal directories.
Click to hide internal directories.