func()

in pkg/gpu/nvidia/beta_plugin.go [39:54]


func (s *pluginServiceV1Beta1) ListAndWatch(emtpy *pluginapi.Empty, stream pluginapi.DevicePlugin_ListAndWatchServer) error {
	glog.Infoln("device-plugin: ListAndWatch start")
	if err := s.sendDevices(stream); err != nil {
		return err
	}
	for {
		select {
		case d := <-s.ngm.Health:
			glog.Infof("device-plugin: %s device marked as %s", d.ID, d.Health)
			s.ngm.SetDeviceHealth(d.ID, d.Health, d.Topology)
			if err := s.sendDevices(stream); err != nil {
				return err
			}
		}
	}
}