wrap payload for all processors

This commit is contained in:
Joel Wetzell
2026-03-16 17:05:49 -05:00
parent b6c1c5c600
commit f273aedbc6
76 changed files with 674 additions and 486 deletions

View File

@@ -16,20 +16,26 @@ type RouterInput struct {
logger *slog.Logger
}
func (ro *RouterInput) Process(ctx context.Context, payload any) (any, error) {
func (ro *RouterInput) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) {
payload := wrappedPayload.Payload
router, ok := ctx.Value(common.RouterContextKey).(common.RouteIO)
if !ok {
return nil, errors.New("router.input no router found")
wrappedPayload.End = true
return wrappedPayload, errors.New("router.input no router found")
}
_, err := router.HandleInput(ctx, ro.SourceId, payload)
if err != nil {
return nil, errors.New("router.input failed to send input")
wrappedPayload.End = true
return wrappedPayload, errors.New("router.input failed to send input")
}
return payload, nil
wrappedPayload.Payload = payload
return wrappedPayload, nil
}
func (ro *RouterInput) Type() string {