Documentation
¶
Overview ¶
Package subscription holds the queue handlers of the scheduled subscription tasks: the lifecycle sweep and the pre-expiry reminder. The business rules live in the subscription module; the handlers only run it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckSubscriptionHandler ¶ added in v1.21.0
type CheckSubscriptionHandler struct {
// contains filtered or unexported fields
}
CheckSubscriptionHandler is the queue shell of the subscription lifecycle sweep. The sweep runs every minute and notifies the owners of the subscriptions it finishes, so a run that outlasts the tick must not overlap the next one: both would select the same rows and the owners would hear twice. The lock keeps the runs apart; a failed run returns its error and asynq retries it.
func NewCheckSubscriptionHandler ¶ added in v1.21.0
func NewCheckSubscriptionHandler(sweeper LifecycleSweeper, rdb *redis.Client) *CheckSubscriptionHandler
NewCheckSubscriptionHandler builds the shell over the subscription facade and the Redis connection holding the run lock.
func (*CheckSubscriptionHandler) ProcessTask ¶ added in v1.21.0
type LifecycleSweeper ¶ added in v1.21.0
LifecycleSweeper is the subscription module's lifecycle sweep.
type RemindExpiringHandler ¶ added in v1.21.0
type RemindExpiringHandler struct {
// contains filtered or unexported fields
}
RemindExpiringHandler is the queue shell of the pre-expiry reminder.
func NewRemindExpiringHandler ¶ added in v1.21.0
func NewRemindExpiringHandler(service module.Service) *RemindExpiringHandler
NewRemindExpiringHandler builds the shell over the subscription facade.