Class: Subscriber

vortexdds~Subscriber()

Represents a DDS subscriber.

A subscriber typically owns one or more Reader instances created via the Subscriber.createReader() method.

Class instances are created by the Participant.createSubscriber() method.

You typically create a Subscriber because you require quality-of-service parameters not available on the 'default subscriber'. Frequently, you wall want to specify a QoS.partition policy so that non-default partitions are used by the contained Reader instances.

Note that DDS resources and memory consumed by DDS entities cannot be automatically reclaimed by the NodeJS engine. Once your application is finished with an Entity, you must call delete() to release these DDS resources.

Constructor

new Subscriber()

Internal use only. Use Participant.createSubscriber()

Extends:
See:

Extends

Members

qos :module:vortexdds.QoS

The existing QoS policies for the entity.

Type:
Overrides:

Methods

createReader(topic, qosopt, listeneropt) → {module:vortexdds.Reader}

Creates a Reader for a topic on this subscriber of the participant.

Similar to Participant.createReader() except that a Reader is created based in QoS properties of this subscriber.

The reader belongs to the subscriber from which it is created, and is automatically deleted when the subscriber is deleted.

Note that DDS resources and memory consumed by DDS entities cannot be automatically reclaimed by the NodeJS engine. Once your application is finished with an Entity, you must call delete() to release these DDS resources.

Parameters:
Name Type Attributes Default Description
topic module:vortexdds.Topic

the topic from which data will be read

qos module:vortexdds.QoS <optional>
QoS.readerDefault()

quality-of-service policies for the reader.

If no argument is provided, then QoS.readerDefault() is used, whereas passing in a null value results in the topic's qos to be used.

listener module:vortexdds~ReaderListener <optional>
null

an object defining listener callbacks for the reader

Throws:

if the reader cannot be created

Type
module:vortexdds.DDSError
Returns:

the Reader instance

Type
module:vortexdds.Reader

createStatusCondition(maskopt) → {module:vortexdds.StatusCondition}

Creates a StatusCondition for use in wait set.

Omitting the mask value results in all entity-appropriate status conditions being enabled.

Note that DDS resources and memory consumed by conditions cannot be automatically reclaimed by the NodeJS engine. Conditions are automatically deleted when the parent entity is deleted. Otherwise, when your application is finished with a Condition, you may call Condition.delete() to release these DDS resources.

Parameters:
Name Type Attributes Default Description
mask module:vortexdds.StatusMask <optional>
null

mask of StatusMask values of interest

Overrides:
Throws:

if the status mask is invalid

Type
module:vortexdds.DDSError
Returns:
Type
module:vortexdds.StatusCondition

delete() → {external:Promise}

Releases the DDS resources associated with the entity and all its 'child' entities.

In some cases, releasing DDS resources can take several seconds. This methods returns a Promise that enables you to do processing after all the resources have been released.

Overrides:
Returns:
Type
external:Promise

findBuiltinDataReader(topicName) → {module:vortexdds.Reader}

Finds the builtin datareader on this subscriber, if the subcriber is builtin.

Parameters:
Name Type Description
topicName string
Throws:

If the reader is not builtin or topicName does not correspond to a builtin topic.

Type
module.vortexdds.DDSError
Returns:

The builtin reader

Type
module:vortexdds.Reader

statusChanges() → {module:vortexdds.StatusMask}

Return the DDS communication statuses that have changed since this method was last called.

Overrides:
Returns:

a mask of statuses that have changed

Type
module:vortexdds.StatusMask