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 void
close()
Optional<SequencedMessage>
messageIfAvailable()
Pull messages if there is any ready to deliver.com.google.api.core.ApiFuture<Void>
onData()
Returns aApiFuture
that will be completed when there are messages available.
-
-
-
Method Detail
-
onData
com.google.api.core.ApiFuture<Void> onData()
Returns aApiFuture
that will be completed when there are messages available. Unfinished existingApiFuture
returned by onData() will be abandoned and superseded by new onData() call.CheckedApiException
will 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:
close
in interfaceAutoCloseable
-
-