-
Notifications
You must be signed in to change notification settings - Fork 1
/
crow.go
18 lines (17 loc) · 1 KB
/
crow.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package murder
// Crow :
// Interface for any storage system for the orchestrator to use
type Crow interface {
QueueSize(string) int // Query main queue size
QueueTimeSinceCreation(string) int // Query time since queue creation
AddToQueue(string, interface{}, bool) // Add object to queue
GetQueueContents(string) []string // Retrieve all contents of queue
ClearQueue(string, string) error // Clear all queue contents
CreateLockKey(string, string, int) bool // Create lock key for a queue, confirm if lock acquired, and set TTL
IsLocked(string) bool // Check if a queue is locked
FindQueueByKey(string) (string, bool) // Get the queue for a lock key if exists
ExtendLockKey(string, int) // Extend TTL of lock key to value provided
RemoveLockKey(string) // Removes a lock key if exists
MoveToReady(string, string) // Move a queue to ready to process queues
GetReadyQueues(string) []string // Get full queues
}