yr.create_stream_consumer

yr.create_stream_consumer#

yr.create_stream_consumer(stream_name: str, config: SubscriptionConfig) Consumer[source]#

Create a consumer.

Parameters:
  • stream_name (str) – The name of the stream. The length must be less than 256 characters and contain only the following characters (a-zA-Z0-9~.-/_!@#%^&*()+=;:) .

  • config (SubscriptionConfig) – The configuration of the consumer.

Returns:

Consumer.

Raises:

RuntimeError – If creating the Consumer fails.

Examples

>>> try:
...     config = yr.SubscriptionConfig("subName", yr.SubscriptionConfig.subscriptionType.STREAM)
...     consumer = yr.create_stream_consumer("streamName", config)
... except RuntimeError as exp:
...     pass