Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NotificationTopicLongest = func() NotificationTopic { return slices.MaxFunc(notificationTopicAll, func(t1, t2 NotificationTopic) int { return len(string(t1)) - len(string(t2)) }) }()
NotificationTopicLongest is just the longest notification topic. This is used to determine the maximum length of allowed custom schema names because schemas are prefixed to notification topic names and Postgres enforces a maximum topic length of 63 characters.
Functions ¶
This section is empty.
Types ¶
type NotificationTopic ¶
type NotificationTopic string
const ( NotificationTopicControl NotificationTopic = "river_control" NotificationTopicInsert NotificationTopic = "river_insert" NotificationTopicLeadership NotificationTopic = "river_leadership" )
type Notifier ¶
type Notifier struct {
baseservice.BaseService
startstop.BaseStartStop
// contains filtered or unexported fields
}
func New ¶
func New(archetype *baseservice.Archetype, listener riverdriver.Listener) *Notifier
func (*Notifier) Listen ¶
func (n *Notifier) Listen(ctx context.Context, topic NotificationTopic, notifyFunc NotifyFunc) (*Subscription, error)
type NotifyFunc ¶
type NotifyFunc func(topic NotificationTopic, payload string)
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
func (*Subscription) Unlisten ¶
func (s *Subscription) Unlisten(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.