Event Broken Concept

This commit is contained in:
Hein
2025-12-12 09:23:54 +02:00
parent 7ef1d6424a
commit 31ad217818
25 changed files with 4074 additions and 3 deletions

View File

@@ -0,0 +1,17 @@
package eventbroker
import "context"
// EventHandler processes an event
type EventHandler interface {
Handle(ctx context.Context, event *Event) error
}
// EventHandlerFunc is a function adapter for EventHandler
// This allows using regular functions as event handlers
type EventHandlerFunc func(ctx context.Context, event *Event) error
// Handle implements EventHandler
func (f EventHandlerFunc) Handle(ctx context.Context, event *Event) error {
return f(ctx, event)
}