nrac_resource_consumer_add()
Abstract
Associate a consumer and a resource. The consumer becomes a user of the resource.
Syntax
nrac_resource_consumer_add (resource_handle, consumer_handle, event_handle)
| Argument | Type | Description |
|---|---|---|
resource_handle |
Nrac_Resource_Handle |
handle for the resource that will be used by the consumer |
consumer_handle |
Nrac_Consumer_Handle |
handle for the consumer that will use the resource |
event_handle |
Nrac_Event_Handle |
handle for a conditionalizing event. Use NRAC_ANY_EVENT to indicate unconditional use of the resource. |
Return Type
Compcode
failure occurs only if this new binding is redundant with previously created ones, or due to insufficient memory resources
Header
nrac.h
Details
Each consumer can use multiple resources and each resource can in turn be used by multiple consumers. Any enforcement of limitations on these associations (e.g., to prevent overloading of resources) is strictly determined by the application and not by the NRAC package. Thus, this call will succeed, except if a redundant association is attempted.
The binding between the consumer and the resource can be made contingent upon a specific event. The event must have been created at some prior point using nrac_event_create(). The event is used to separate different consumers which use the resource under different circumstances. Thus, a resource may support many consumers, but still not be “overloaded” since those consumers would not necessarily use the resource simultaneously. To specify that the consumer uses the resource no matter what, pass the special event handle NRAC_ANY_EVENT for the event argument. A single resource can support a mix of conditional and unconditional consumers.