2023-12-31 18:04:28 +08:00
|
|
|
package function
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2024-01-01 17:49:27 +08:00
|
|
|
"kis-flow/kis"
|
2024-01-02 15:38:51 +08:00
|
|
|
"kis-flow/log"
|
2023-12-31 18:04:28 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
type KisFunctionL struct {
|
|
|
|
BaseFunction
|
|
|
|
}
|
|
|
|
|
2024-01-01 17:49:27 +08:00
|
|
|
func (f *KisFunctionL) Call(ctx context.Context, flow kis.Flow) error {
|
2024-01-02 15:38:51 +08:00
|
|
|
log.Logger().InfoF("KisFunctionL, flow = %+v\n", flow)
|
2023-12-31 18:04:28 +08:00
|
|
|
|
2024-01-04 16:36:36 +08:00
|
|
|
// 通过KisPool 路由到具体的执行计算Function中
|
|
|
|
if err := kis.Pool().CallFunction(ctx, f.Config.FName, flow); err != nil {
|
|
|
|
log.Logger().ErrorFX(ctx, "Function Called Error err = %s\n", err)
|
|
|
|
return err
|
|
|
|
}
|
2023-12-31 18:04:28 +08:00
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|