Skip to content

Commit 621804b

Browse files
committed
1 parent 725237d commit 621804b

2 files changed

Lines changed: 28 additions & 5 deletions

File tree

polycode/client.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,12 @@ type ExecAppResponse struct {
7575
}
7676

7777
type ExecApiRequest struct {
78-
EnvId string `json:"envId"`
79-
Controller string `json:"controller"`
80-
Path string `json:"path"`
81-
Options TaskOptions `json:"options"`
82-
Request ApiRequest `json:"request"`
78+
EnvId string `json:"envId"`
79+
Controller string `json:"controller"`
80+
Path string `json:"path"`
81+
Options TaskOptions `json:"options"`
82+
FireAndForget bool `json:"fireAndForget"`
83+
Request ApiRequest `json:"request"`
8384
}
8485

8586
type ExecApiExtendedRequest struct {

polycode/service.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,28 @@ func (r RemoteController) RequestReply(options TaskOptions, path string, apiReq
286286
return output.Response, nil
287287
}
288288

289+
func (r RemoteController) Send(options TaskOptions, path string, apiReq ApiRequest) error {
290+
req := ExecApiRequest{
291+
EnvId: r.envId,
292+
Controller: r.controller,
293+
Path: path,
294+
Options: options,
295+
FireAndForget: true,
296+
Request: apiReq,
297+
}
298+
299+
output, err := r.serviceClient.ExecApi(r.sessionId, req)
300+
if err != nil {
301+
return err
302+
}
303+
304+
if output.IsError {
305+
return output.Error
306+
}
307+
308+
return nil
309+
}
310+
289311
type Memo struct {
290312
ctx context.Context
291313
sessionId string

0 commit comments

Comments
 (0)