cc-priority-queue

command module
v0.0.0-...-4d5320e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2019 License: MIT Imports: 10 Imported by: 0

README

Concord PQ

Concord PQ is a priority queue for queueing tasks for a specific resource. The PQ priority is time based with lowest runtimes tasks taking prescedence over tasks with high runtimes.

Usage

To build the docker image run:

make build

To run the full test suite run:

make test

To run the short (dependency free) test suite run:

make test-short

JSON-RPC 2.0 HTTP API - Method Reference

This service uses the JSON-RPC 2.0 Spec over HTTP for its API.


get(key) : get a queue by key

Parameters:

key - (String) the queue key.

Returns:

(Object) the queue with the associated key


getAll() : get all queues

Returns:

(Array) the list of all existing queues


peek(key) : return the next task from the queue

Parameters:

key - (String) the queue key.

Returns:

(Object) the next task in queue


pop(key) : remove and return the next task from the queue

Parameters:

key - (String) the queue key.

Returns:

(Object) the next task in queue


push(key, id, priority) : add a task to a queue

Parameters:

key - (String) the resource key for the task.

id - (String) the id of the task.

priority - (Number) the priority value for the task. Lower values have highest priority.

Returns:

(Number) 0 on success or -1 on failure


remove(key, id) - remove a task from a queue

Parameters:

key - (String) the queue key.

id - (String) the id of the task.

Returns:

(Number) 0 on success or -1 on failure

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL