.. _alresourcemanager-tuto: ALResourceManager Tutorial ================================= :ref:`Overview ` | :ref:`API ` | Tutorial Introduction ------------ This tutorial explains how to use the ALResourceManager module. .. note:: The tutorial is written in Python. Create a resource ----------------- .. code-block:: python # create proxy on resource manager proxy = ALProxy("ALResourceManager","localhost",9559) #createResource in root (parent resource is "") proxy.createResource("newResource","") Check if a resource is available -------------------------------- .. code-block:: python #check resource is free free = proxy.areResourcesFree(["newResource"]) Wait resource become available (blocking call) ---------------------------------------------- .. code-block:: python # 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 taken with waitForResource ------------------------------------------- .. code-block:: python #release resource proxy.releaseResource("newResource", "newOwner")