new Topic(iterator, talk, cancel)
Construct a topic. (Only for internal use)
Parameters:
| Name | Type | Description |
|---|---|---|
iterator |
generator | An async iterator to represent data from OpenSpace. |
talk |
function | The funciton used to send messages. |
cancel |
function | The funciton used to cancel the topic. |
Methods
cancel()
Cancel the topic.
iterator()
Get the async iterator used to get data from OpenSpace.
talk(data)
Send data within a topic
Parameters:
| Name | Type | Description |
|---|---|---|
data |
object | The JavaScript object to send. Must be possible to encode into JSON. |