bouncer/internal/proxy/director/layer/queue/adapter.go

20 lines
532 B
Go
Raw Normal View History

2023-04-24 20:52:12 +02:00
package queue
import (
"context"
"time"
)
type Status struct {
Sessions int64
}
type Adapter interface {
2024-06-05 12:52:01 +02:00
// Touch updates the session TTL and returns its current rank
2023-04-24 20:52:12 +02:00
Touch(ctx context.Context, queueName string, sessionId string) (int64, error)
2024-06-05 12:52:01 +02:00
// Status returns the queue current status
2023-04-24 20:52:12 +02:00
Status(ctx context.Context, queueName string) (*Status, error)
2024-06-05 12:52:01 +02:00
// Refresh forces a refresh of the queue, taking into account the given TTL for sessions
2023-04-24 20:52:12 +02:00
Refresh(ctx context.Context, queueName string, keepAlive time.Duration) error
}