This tutorial explains how to use the ALResourceManager module.
Note
The tutorial is written in Python.
# create proxy on resource manager
proxy = ALProxy("ALResourceManager","localhost",9559)
#createResource in root (parent resource is "")
proxy.createResource("newResource","")
#check resource is free
free = proxy.areResourcesFree(["newResource"])
# take resource
# waitForResource(resource name, owner name, callback to notify you that someone want the resource, timeout)
proxy.waitForResource("newResource", "newOwner", "callback", 1)
#release resource
proxy.releaseResource("newResource", "newOwner")