From 4ca27aec303f54dc9ee670c67c2fefa80dd004a1 Mon Sep 17 00:00:00 2001 From: SangTran-127 Date: Sun, 9 Aug 2026 18:32:44 +0700 Subject: feat: add KeyByOperator and wordCounter for stateful processing --- core/operator/operator.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 core/operator/operator.go (limited to 'core/operator/operator.go') diff --git a/core/operator/operator.go b/core/operator/operator.go new file mode 100644 index 0000000..d4bf21b --- /dev/null +++ b/core/operator/operator.go @@ -0,0 +1,16 @@ +package operator + +import ( + "context" + "goflink/core" +) + +type Emitter[OUT any] interface { + Emit(ctx context.Context, record core.StreamRecord[OUT]) error +} + +type Operator[IN, OUT any] interface { + Open(ctx context.Context) error + Process(ctx context.Context, record core.StreamRecord[IN], out Emitter[OUT]) error + Close(ctx context.Context) error +} -- cgit v1.2.3