make_subscriber() makes a StreamingPullFuture (while make_async_subscriber() seems like something users are expected to use):
| defmake_subscriber( |
| subscription: SubscriptionPath, |
| per_partition_flow_control_settings: FlowControlSettings, |
| callback: MessageCallback, |
| nack_handler: Optional[NackHandler] =None, |
| message_transformer: Optional[MessageTransformer] =None, |
| fixed_partitions: Optional[Set[Partition]] =None, |
| executor: Optional[ThreadPoolExecutor] =None, |
| credentials: Optional[Credentials] =None, |
| client_options: Optional[ClientOptions] =None, |
| metadata: Optional[Mapping[str, str]] =None, |
| ) ->StreamingPullFuture: |
Current:
streaming_pull_future=make_subscriber( subscription_path, per_partition_flow_control_settings=flow_control_settings, callback=callback, )
streaming_pull_future.result(timeout=timeout)
Expected:
streaming_pull_future=subscriber_client.subscribe( subscription_path, per_partition_flow_control_settings=flow_control_settings, callback=callback, )
streaming_pull_future.result(timeout=timeout)
make_subscriber()makes aStreamingPullFuture(whilemake_async_subscriber()seems like something users are expected to use):python-pubsublite/google/cloud/pubsublite/cloudpubsub/make_subscriber.py
Lines 205 to 216 in ec19dfc
Current:
Expected: