feedkit: split the former maximumdirect.net/weatherd project in two.
feedkit now contains a reusable core, while weatherfeeder is a concrete implementation that includes weather-specific functions.
This commit is contained in:
16
sinks/sink.go
Normal file
16
sinks/sink.go
Normal file
@@ -0,0 +1,16 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user