aboutsummaryrefslogtreecommitdiff
path: root/core/operator/operator.go
blob: 0c588e5ec5f09ee4573f1370dc079776d852b920 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package operator

import (
	"context"
	"flux/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
}