RunInBackground runs f in a background goroutine in this process. f is provided a context that may outlast the context provided to RunInBackground. This is only valid to invoke from a service set to basic or manual scaling.
(c context.Context, f func(c context.Context))
| 133 | // f is provided a context that may outlast the context provided to RunInBackground. |
| 134 | // This is only valid to invoke from a service set to basic or manual scaling. |
| 135 | func RunInBackground(c context.Context, f func(c context.Context)) error { |
| 136 | req := &pb.StartBackgroundRequestRequest{} |
| 137 | res := &pb.StartBackgroundRequestResponse{} |
| 138 | if err := internal.Call(c, "system", "StartBackgroundRequest", req, res); err != nil { |
| 139 | return err |
| 140 | } |
| 141 | sendc <- send{res.GetRequestId(), f} |
| 142 | return nil |
| 143 | } |
| 144 | |
| 145 | func init() { |
| 146 | internal.RegisterErrorCodeMap("system", pb.SystemServiceError_ErrorCode_name) |
searching dependent graphs…