forked from riverqueue/river
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.go
25 lines (21 loc) · 927 Bytes
/
plugin.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package river
import (
"github.com/riverqueue/river/rivershared/baseservice"
"github.com/riverqueue/river/rivershared/startstop"
)
// A plugin API that drivers may implement to extend a River client. Driver
// plugins may, for example, add additional maintenance services.
//
// This should be considered a River internal API and its stability is not
// guaranteed. DO NOT USE.
type driverPlugin[TTx any] interface {
// PluginInit initializes a plugin with an archetype and client. It's
// invoked on Client.NewClient.
PluginInit(archetype *baseservice.Archetype, client *Client[TTx])
// PluginMaintenanceServices returns additional maintenance services (will
// only run on an elected leader) for a River client.
PluginMaintenanceServices() []startstop.Service
// PluginServices returns additional non-maintenance services (will run on
// all clients) for a River client.
PluginServices() []startstop.Service
}