Adding Concurrency in Pool Manager (#1698)

Concurrency in the pool manager allows specializing pods concurrently based on a specified limit. 

Co-authored-by: Vishal <vishal-biyani@users.noreply.github.com>
This commit is contained in:
Rahul Bhati
2020-09-16 18:48:08 +05:30
committed by GitHub
co-authored by Vishal
parent c1ac7fcd38
commit f3fe3123b3
25 changed files with 659 additions and 402 deletions
+26
View File
@@ -91,6 +91,32 @@ func (c *Client) GetServiceForFunction(ctx context.Context, metadata *metav1.Obj
return string(svcName), nil
}
func (c *Client) UnTapService(ctx context.Context, fnMeta metav1.ObjectMeta, executorType fv1.ExecutorType, serviceUrl *url.URL) error {
url := c.executorUrl + "/v2/unTapService"
tapSvc := TapServiceRequest{
FnMetadata: fnMeta,
FnExecutorType: executorType,
ServiceUrl: strings.TrimPrefix(serviceUrl.String(), "http://"),
}
body, err := json.Marshal(tapSvc)
if err != nil {
return errors.Wrap(err, "could not marshal request body for getting service for function")
}
resp, err := ctxhttp.Post(ctx, c.httpClient, url, "application/json", bytes.NewReader(body))
if err != nil {
return errors.Wrap(err, "error posting to getting service for function")
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
return ferror.MakeErrorFromHTTP(resp)
}
return nil
}
func (c *Client) service() {
ticker := time.NewTicker(time.Second * 5)
for {