2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-08-19 15:08:55 +08:00

Move all inspector related code to subpackage inspeq

This commit is contained in:
Ken Hibino
2021-01-28 08:59:13 -08:00
parent eba7c4e085
commit e13122723a
6 changed files with 627 additions and 469 deletions

View File

@@ -36,6 +36,15 @@ const (
CancelChannel = "asynq:cancel" // PubSub channel
)
// ValidateQueueName validates a given qname to be used as a queue name.
// Returns nil if valid, otherwise returns non-nil error.
func ValidateQueueName(qname string) error {
if len(qname) == 0 {
return fmt.Errorf("queue name must contain one or more characters")
}
return nil
}
// QueueKey returns a redis key for the given queue name.
func QueueKey(qname string) string {
return fmt.Sprintf("asynq:{%s}", qname)