From 0958e46c3651f2c8b6d76bcffbd8820063647d59 Mon Sep 17 00:00:00 2001 From: SangTran-127 Date: Sat, 8 Aug 2026 17:24:01 +0700 Subject: refactor: add context support to transport operators and runtime task management --- core/operator.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'core/operator.go') 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 } -- cgit v1.2.3