feedkit now contains a reusable core, while weatherfeeder is a concrete implementation that includes weather-specific functions.
17 lines
402 B
Go
17 lines
402 B
Go
package sinks
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gitea.maximumdirect.net/ejr/feedkit/event"
|
|
)
|
|
|
|
// Sink is an adapter that consumes a stream of domain-agnostic events.
|
|
//
|
|
// Sinks MUST respect ctx.Done() whenever they do I/O or blocking work.
|
|
// (Fanout timeouts only help if the sink cooperates with context cancellation.)
|
|
type Sink interface {
|
|
Name() string
|
|
Consume(ctx context.Context, e event.Event) error
|
|
}
|