enqueue-client
Javascript client of enqueue server
lockClient.lock(elementaryLock, callback)
Acquire a lock for the elementaryLock. The callback will be called once the result is received.
var elementaryLock = "name":"product""argument":"Computer""mode":"E""owner":"B";lockClient;
lockClient.unlock(lockUUID [,callback])
Release the lock with the specified lock UUID. The callback is optional.
lockClient;
lockClient.promote(lockUUID, callback)
Promote the optimistic lock with the specified lock UUID. The callback receives the response from server.
lockClient;
lockClient.getLocksBy(lockName, lockOwner, callback)
Get a list of existing locks in the enqueue server by lockName and lockOwner. The callback receives an array of locks. If you give both lockName and lockOwner, it filters with both. If you only give either lockName or lockOwner, it filters with one of the given. If you assign null for both, it return the complete lock list.
lockClient;
lockClient.setEnqueueServerConnection(host, port)
Set the remote enqueue server's host and port. The method is optional if the enqueue server lies on the same server as the lock client. As the default host and port are "127.0.0.1" and "3721".