Periodic tasks refactor (#62)
* Once every second the session run a list of periodic tasks on every instance concurrently. We use these tasks to do things like: - Collect mem and cpu stats - Check if instance is part of a swarm cluster - Broadcast information to connected clients
This commit is contained in:
committed by
GitHub
parent
07fee4c1bf
commit
afa47c0bfc
8
services/broadcast_info_task.go
Normal file
8
services/broadcast_info_task.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package services
|
||||
|
||||
type broadcastInfoTask struct {
|
||||
}
|
||||
|
||||
func (c *broadcastInfoTask) Run(i *Instance) {
|
||||
wsServer.BroadcastTo(i.session.Id, "instance stats", i.Name, i.Mem, i.Cpu, i.IsManager)
|
||||
}
|
||||
Reference in New Issue
Block a user