Constructor
new Subscriptions(httpConnection)
Creates a new object that handles the subscriptions.
Parameters:
| Name | Type | Description |
|---|---|---|
httpConnection |
Connection | A Connection object representing an established connection to an openEO back-end. |
Methods
subscribe(topic, callback, parametersopt)
Subscribes to a topic.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
topic |
string | The topic to subscribe to. | ||
callback |
incomingMessageCallback | A callback that is executed when a message for the topic is received. | ||
parameters |
object |
<optional> |
{} | Parameters for the subscription request, for example a job id. |
Throws:
Error
unsubscribe(topic, parametersopt)
Unsubscribes from a topic.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
topic |
string | The topic to unsubscribe from. | ||
parameters |
object |
<optional> |
{} | Parameters that have been used to subsribe to the topic. |
Throws:
Error