bouncer/internal/proxy/director/layer/queue/adapter.go
William Petit c7ac331b10
Some checks failed
Cadoles/bouncer/pipeline/head There was a failure building this commit
chore: add interface description
2024-06-05 12:52:01 +02:00

20 lines
532 B
Go

package queue
import (
"context"
"time"
)
type Status struct {
Sessions int64
}
type Adapter interface {
// Touch updates the session TTL and returns its current rank
Touch(ctx context.Context, queueName string, sessionId string) (int64, error)
// Status returns the queue current status
Status(ctx context.Context, queueName string) (*Status, error)
// Refresh forces a refresh of the queue, taking into account the given TTL for sessions
Refresh(ctx context.Context, queueName string, keepAlive time.Duration) error
}