# Class: ServicePublisher

## vertx-service-discovery-js/service_publisher~ ServicePublisher

#### new ServicePublisher()

The publisher is used by the importer to publish or unpublish records.

Source:
  - vertx-service-discovery-js/service_publisher.js, line 30

### Methods

#### publish(record, resultHandler)

Publishes a record.

##### Parameters:

Name | Type | Description
--- | --- | ---
`record` | Object | the record
`resultHandler` | function | handler called when the operation has completed (successfully or not). In case of success, the passed record has a registration id required to modify and un-register the service.

Source:
  - vertx-service-discovery-js/service_publisher.js, line 42

#### unpublish(id, resultHandler)

Un-publishes a record.

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | string | the registration id
`resultHandler` | function | handler called when the operation has completed (successfully or not).

Source:
  - vertx-service-discovery-js/service_publisher.js, line 62