boaty-client
A node client for the boaty mcboatface job server
Installation
npm install --save boaty-mcboatface-client
Usage
To creating a new or assume an existing queue with one operation:
const Client = ;const GUID = Math); // NOTE: The Boaty client assumes a trailing slash.const boaty = GUID "first,second,third" "http://URL_TO_BOATY_SERVER:port/";const nextItem = boaty;
Checking if a queue with a given guid
exists and whether work remains to be done:
const Client = ;const GUID = "ABC123"; // NOTE: The Boaty client assumes a trailing slash.// NOTE: The Boaty client throws an error if the server returns a garbled or non-404 error result.const queue = Client; if queue if queuelength > 0 // The queue exists and still has work to claim console; else // This queue may have already had all its work claimed console; else // No queue with this guid has been created recently console;
License
All code not otherwise specified is Copyright Wal-Mart Stores, Inc. Released under the MIT License.