aboutsummaryrefslogtreecommitdiff
path: root/core/operator.go
blob: 7785d444f8e743dcdf05daae538da550dfc7a51a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
package core

import "context"

type Emitter[OUT any] interface {
	Emit(ctx context.Context, record StreamRecord[OUT]) error
}

type Operator[IN, OUT any] interface {
	Open(ctx context.Context) error
	Process(ctx context.Context, record StreamRecord[IN], out Emitter[OUT]) error
	Close(ctx context.Context) error
}