# Class: ServiceReference

## vertx-service-discovery-js/service_reference~ ServiceReference

#### new ServiceReference()

Source:
  - vertx-service-discovery-js/service_reference.js, line 29

### Methods

#### cached() → {Object}

Gets the service object if already retrieved. It won't try to acquire the service object if not retrieved yet.

Source:
  - vertx-service-discovery-js/service_reference.js, line 72

##### Returns:

the object, `null` if not yet retrieved

Type
  Object

#### get() → {Object}

Gets the object to access the service. It can be a proxy, a client or whatever object. The type depends on the service type and the server itself.

Source:
  - vertx-service-discovery-js/service_reference.js, line 58

##### Returns:

the object to access the service

Type
  Object

#### record() → {Object}

Source:
  - vertx-service-discovery-js/service_reference.js, line 40

##### Returns:

the service record.

Type
  Object

#### release()

Releases the reference. Once released, the consumer must not use the reference anymore. This method must be idempotent and defensive, as multiple call may happen.

Source:
  - vertx-service-discovery-js/service_reference.js, line 86