| "veyron.io/veyron/veyron2/context" |
| "veyron.io/veyron/veyron2/mgmt" |
| "veyron.io/veyron/veyron2/vlog" |
| "veyron.io/veyron/veyron/lib/exec" |
| "veyron.io/veyron/veyron/services/mgmt/node" |
| // InvokeCallback provides the parent node manager with the given name (which |
| // is expected to be this node manager's object name). |
| func InvokeCallback(ctx context.T, name string) { |
| handle, err := exec.GetChildHandle() |
| // Node manager was started by self-update, notify the parent. |
| callbackName, err := handle.Config.Get(mgmt.ParentNameConfigKey) |
| // Node manager was not started by self-update, return silently. |
| nmClient := node.ConfigClient(callbackName) |
| ctx, cancel := ctx.WithTimeout(ipcContextTimeout) |
| if err := nmClient.Set(ctx, mgmt.ChildNameConfigKey, name); err != nil { |
| vlog.Fatalf("Set(%v, %v) failed: %v", mgmt.ChildNameConfigKey, name, err) |
| vlog.Fatalf("GetChildHandle() failed: %v", err) |