Class BlockingPullSubscriberImpl
- java.lang.Object
-
- com.google.cloud.pubsublite.internal.BlockingPullSubscriberImpl
-
- All Implemented Interfaces:
BlockingPullSubscriber,AutoCloseable
public class BlockingPullSubscriberImpl extends Object implements BlockingPullSubscriber
-
-
Constructor Summary
Constructors Constructor Description BlockingPullSubscriberImpl(SubscriberFactory factory, FlowControlSettings settings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Optional<SequencedMessage>messageIfAvailable()Pull messages if there is any ready to deliver.com.google.api.core.ApiFuture<Void>onData()Returns aApiFuturethat will be completed when there are messages available.
-
-
-
Constructor Detail
-
BlockingPullSubscriberImpl
public BlockingPullSubscriberImpl(SubscriberFactory factory, FlowControlSettings settings) throws CheckedApiException
- Throws:
CheckedApiException
-
-
Method Detail
-
onData
public com.google.api.core.ApiFuture<Void> onData()
Description copied from interface:BlockingPullSubscriberReturns aApiFuturethat will be completed when there are messages available. Unfinished existingApiFuturereturned by onData() will be abandoned and superseded by new onData() call.CheckedApiExceptionwill be set to the Future if there is underlying permanent error.- Specified by:
onDatain interfaceBlockingPullSubscriber
-
messageIfAvailable
public Optional<SequencedMessage> messageIfAvailable() throws CheckedApiException
Description copied from interface:BlockingPullSubscriberPull messages if there is any ready to deliver. Any message will only be delivered to one call if there are multiple concurrent calls.- Specified by:
messageIfAvailablein interfaceBlockingPullSubscriber- Throws:
CheckedApiException- if there is underlying permanent error.
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBlockingPullSubscriber
-
-