diff options
Diffstat (limited to 'core/operator.go')
| -rw-r--r-- | core/operator.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/operator.go b/core/operator.go index 40d0ca6..7785d44 100644 --- a/core/operator.go +++ b/core/operator.go @@ -1,11 +1,13 @@ package core +import "context" + type Emitter[OUT any] interface { - Emit(record StreamRecord[OUT]) error + Emit(ctx context.Context, record StreamRecord[OUT]) error } type Operator[IN, OUT any] interface { - Open() error - Process(record StreamRecord[IN], out Emitter[OUT]) error - Close() error + Open(ctx context.Context) error + Process(ctx context.Context, record StreamRecord[IN], out Emitter[OUT]) error + Close(ctx context.Context) error } |