mirror of
https://github.com/aceld/kis-flow.git
synced 2025-01-22 23:20:24 +08:00
34 lines
663 B
Go
34 lines
663 B
Go
package function
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/aceld/kis-flow/kis"
|
|
"github.com/aceld/kis-flow/log"
|
|
)
|
|
|
|
type KisFunctionS struct {
|
|
BaseFunction
|
|
}
|
|
|
|
func NewKisFunctionS() kis.Function {
|
|
f := new(KisFunctionS)
|
|
|
|
// Initialize metaData
|
|
f.metaData = make(map[string]interface{})
|
|
|
|
return f
|
|
}
|
|
|
|
func (f *KisFunctionS) Call(ctx context.Context, flow kis.Flow) error {
|
|
log.Logger().DebugF("KisFunctionS, flow = %+v\n", flow)
|
|
|
|
// Route to the specific computing Function through KisPool
|
|
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
|
|
}
|
|
|
|
return nil
|
|
}
|