add some context for output to potentially use later

This commit is contained in:
Joel Wetzell
2025-11-27 09:06:59 -05:00
parent dce7e13d0f
commit 8bb60a3a3c
2 changed files with 5 additions and 4 deletions

View File

@@ -59,9 +59,9 @@ func (r *Route) HandleInput(sourceId string, payload any) error {
return nil
}
}
return r.HandleOutput(payload)
return r.HandleOutput(sourceId, payload)
}
func (r *Route) HandleOutput(payload any) error {
return r.router.HandleOutput(r.Output, payload)
func (r *Route) HandleOutput(sourceId string, payload any) error {
return r.router.HandleOutput(sourceId, r.Output, payload)
}

View File

@@ -157,9 +157,10 @@ func (r *Router) HandleInput(sourceId string, payload any) []RoutingError {
return routingErrors
}
func (r *Router) HandleOutput(destinationId string, payload any) error {
func (r *Router) HandleOutput(sourceId string, destinationId string, payload any) error {
for _, moduleInstance := range r.ModuleInstances {
if moduleInstance.Id() == destinationId {
slog.Debug("routing", "source", sourceId, "destination", destinationId, "payload", payload)
return moduleInstance.Output(payload)
}
}