StreamLayerClient | @here/olp-sdk-ts
Class StreamLayerClient
Hierarchy
- StreamLayerClient
Index
Constructors
Properties
Methods
Constructors
constructor
Creates the StreamLayerClient instance.
Parameters
params: StreamLayerClientParams
The StreamLayerClientParams instance.
Returns StreamLayerClient
The StreamLayerClient instance.
Properties
Protected Readonly catalog Hrn
Protected Readonly layer Id
Protected Readonly settings
Protected Optional subscribtion Node Base Url
Protected Optional x Correlation Id
Methods
get Data
Fetches partition data using data handle.
Parameters
message: Message
The message data of partition metadata.
Optional abortSignal: AbortSignal
A signal object that allows you to communicate with a request (such as the
fetchrequest) and, if required, abort it using theAbortControllerobject.For more information, see the
AbortControllerdocumentation.
Returns Promise<Response>
The data from the requested partition.
poll
Consumes data from a layer. Returns messages from a stream layer. If the data size is less than 1 MB, the data field will be populated. If the data size is greater than 1 MB, a data handle will be returned pointing to the object stored in the Blob store.
Parameters
request: PollRequest
The PollRequest instance of the configured request parameters.
Optional abortSignal: AbortSignal
A signal object that allows you to communicate with a request (such as the
fetchrequest) and, if required, abort it using theAbortControllerobject.For more information, see the
AbortControllerdocumentation.
Returns Promise<Message[]>
Messages [[StreamApi.Messages]] from a stream layer
seek
Method allows to start reading data from a specified offset. The message pointer can be moved to any offset in the layer (topic). Message consumption will start from that offset. Once you seek to an offset, there is no returning to the initial offset, unless the initial offset is saved.
Parameters
request: SeekRequest
The SeekRequest instance of the configured request parameters.
Optional abortSignal: AbortSignal
A signal object that allows you to communicate with a request (such as the
fetchrequest) and, if required, abort it using theAbortControllerobject.For more information, see the
AbortControllerdocumentation.
Returns Promise<Response>
Response with status 200 if success.
subscribe
Enables message consumption from a specific stream layer. Use the base path returned from the API Lookup service. For mode = parallel, one unit of parallelism currently equals 1 MBps inbound or 2 MBps outbound, whichever is greater, rounded up to the nearest integer. The number of subscriptions within the same group cannot exceed the parallelism allowed. For more details see Get Data from a Stream Layer
Parameters
request: SubscribeRequest
The SubscribeRequest instance of the configured request parameters.
Optional abortSignal: AbortSignal
A signal object that allows you to communicate with a request (such as the
fetchrequest) and, if required, abort it using theAbortControllerobject.For more information, see the
AbortControllerdocumentation.
Returns Promise<string>
Subscription Id
unsubscribe
Method deletes a subscription to a layer. This operation removes the subscription from the service.
Parameters
request: UnsubscribeRequest
The UnsubscribeRequest instance of the configured request parameters.
Optional abortSignal: AbortSignal
A signal object that allows you to communicate with a request (such as the
fetchrequest) and, if required, abort it using theAbortControllerobject.For more information, see the
AbortControllerdocumentation.
Returns Promise<Response>
Generated using TypeDoc
Describes a stream layer.