mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-26 21:05:30 +00:00
add some context for output to potentially use later
This commit is contained in:
6
route.go
6
route.go
@@ -59,9 +59,9 @@ func (r *Route) HandleInput(sourceId string, payload any) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return r.HandleOutput(payload)
|
return r.HandleOutput(sourceId, payload)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Route) HandleOutput(payload any) error {
|
func (r *Route) HandleOutput(sourceId string, payload any) error {
|
||||||
return r.router.HandleOutput(r.Output, payload)
|
return r.router.HandleOutput(sourceId, r.Output, payload)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,9 +157,10 @@ func (r *Router) HandleInput(sourceId string, payload any) []RoutingError {
|
|||||||
return routingErrors
|
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 {
|
for _, moduleInstance := range r.ModuleInstances {
|
||||||
if moduleInstance.Id() == destinationId {
|
if moduleInstance.Id() == destinationId {
|
||||||
|
slog.Debug("routing", "source", sourceId, "destination", destinationId, "payload", payload)
|
||||||
return moduleInstance.Output(payload)
|
return moduleInstance.Output(payload)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user