mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-08-20 13:38:59 +00:00
switch modules to accept an InputHandler instead of the full router
This commit is contained in:
@@ -20,12 +20,12 @@ type RouterInput struct {
|
||||
func (ro *RouterInput) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) {
|
||||
|
||||
payload := wrappedPayload.Payload
|
||||
if wrappedPayload.Router == nil {
|
||||
if wrappedPayload.InputHandler == nil {
|
||||
wrappedPayload.End = true
|
||||
return wrappedPayload, errors.New("router.input no router found")
|
||||
return wrappedPayload, errors.New("router.input no input handler found")
|
||||
}
|
||||
|
||||
_, err := wrappedPayload.Router.HandleInput(ctx, ro.SourceId, payload)
|
||||
_, err := wrappedPayload.InputHandler(ctx, ro.SourceId, payload)
|
||||
|
||||
if err != nil {
|
||||
wrappedPayload.End = true
|
||||
|
||||
Reference in New Issue
Block a user