public interface SequencedPublisher<ResponseT> extends ApiService, Flushable
A PubSub Lite publisher that requires a sequence number assigned to every message, for publish idempotency. Errors are handled out of band. Thread safe.
Type Parameter |
|
---|---|
Name | Description |
ResponseT |
Methods
cancelOutstandingPublishes()
public abstract void cancelOutstandingPublishes()
Attempts to cancel all outstanding publishes.
publish(PubSubMessage message, PublishSequenceNumber sequenceNumber)
public abstract ApiFuture<ResponseT> publish(PubSubMessage message, PublishSequenceNumber sequenceNumber)
Publish a new message with an assigned sequence number.
Behavior is undefined if a call to flush() is outstanding or close() has already been called. This method never blocks.
Guarantees that if a single publish future has an exception set, all publish calls made after that will also have an exception set.
Parameters | |
---|---|
Name | Description |
message |
PubSubMessage |
sequenceNumber |
PublishSequenceNumber |
Returns | |
---|---|
Type | Description |
ApiFuture<ResponseT> |