aboutsummaryrefslogtreecommitdiff
path: root/core/operator.go
diff options
context:
space:
mode:
authorSangTran-127 <tranquangsang12.7@gmail.com>2026-08-08 17:24:01 +0700
committerSangTran-127 <tranquangsang12.7@gmail.com>2026-08-08 17:24:01 +0700
commit0958e46c3651f2c8b6d76bcffbd8820063647d59 (patch)
tree1e917ed409eddc0b3c29fd602e551778c96c8dc6 /core/operator.go
parentacc0b6fbaace61a3befd7f726f9d80fb69391126 (diff)
downloadgoflink-0958e46c3651f2c8b6d76bcffbd8820063647d59.tar.gz
goflink-0958e46c3651f2c8b6d76bcffbd8820063647d59.zip
refactor: add context support to transport operators and runtime task management
Diffstat (limited to 'core/operator.go')
-rw-r--r--core/operator.go10
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
}