Interface BlockingPullSubscriber
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
BlockingPullSubscriberImpl
@ThreadSafe public interface BlockingPullSubscriber extends AutoCloseable
-
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Method Detail
-
onData
com.google.api.core.ApiFuture<Void> onData()
Returns 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.
-
messageIfAvailable
Optional<SequencedMessage> messageIfAvailable() throws CheckedApiException
Pull messages if there is any ready to deliver. Any message will only be delivered to one call if there are multiple concurrent calls.- Throws:
CheckedApiException- if there is underlying permanent error.
-
close
void close()
- Specified by:
closein interfaceAutoCloseable
-
-