Documentation
¶
Overview ¶
Package topicrank marks topics for asynchronous score updates.
Index ¶
- func Defer(ctx context.Context, entry ScheduledTopic, until time.Time) error
- func Import(ctx context.Context, entries []Entity) error
- func MarkAt(ctx context.Context, topicID uint64, now time.Time) error
- func Notify(topicID uint64)
- func SetNext(ctx context.Context, entry ScheduledTopic, next *time.Time) error
- func Wakeups() <-chan struct{}
- type Entity
- type ScheduledTopic
- type TopicRankRequested
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Import ¶
Import preserves any schedule already written by a previous migration attempt or a running producer. It never resets an existing version or deadline.
func Notify ¶
func Notify(topicID uint64)
Notify uses the existing asynchronous event bus; it performs no database I/O.
Types ¶
type Entity ¶
type Entity struct {
TopicID uint64 `gorm:"column:topic_id;primaryKey;autoIncrement:false"`
NextRunAt *time.Time `gorm:"column:next_run_at;index:idx_topic_rank_due,priority:1"`
Version uint64 `gorm:"column:version;not null;default:1"`
}
Keep settled rows so versions cannot reset after deleting/recreating a task.
type ScheduledTopic ¶
type TopicRankRequested ¶
TopicRankRequested carries values only, never a request context or transaction handle.
Click to show internal directories.
Click to hide internal directories.