public static final class PubsubGrpc.PubsubStub extends io.grpc.stub.AbstractAsyncStub<PubsubGrpc.PubsubStub>
For working with topics in a cache. Momento topics are conceptually located on a cache. They are best-effort multicast. To use them, create a cache then start subscribing and publishing! Momento topic subscriptions try to give you information about the quality of the stream you are receiving. For example, you might miss messages if your network is slow, or if some intermediate switch fails, or due to rate limiting. It is also possible, though we try to avoid it, that messages could briefly come out of order between subscribers. We try to tell you when things like this happen via a Discontinuity in your subscription stream. If you do not care about occasional discontinuities then don't bother handling them! You might still want to log them just in case ;-)
| Modifier and Type | Method and Description |
|---|---|
protected PubsubGrpc.PubsubStub |
build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) |
void |
publish(_PublishRequest request,
io.grpc.stub.StreamObserver<_Empty> responseObserver)
Publish a message to a topic.
|
void |
subscribe(_SubscriptionRequest request,
io.grpc.stub.StreamObserver<_SubscriptionItem> responseObserver)
Subscribe to notifications from a topic.
|
protected PubsubGrpc.PubsubStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)
build in class io.grpc.stub.AbstractStub<PubsubGrpc.PubsubStub>public void publish(_PublishRequest request, io.grpc.stub.StreamObserver<_Empty> responseObserver)
Publish a message to a topic. If a topic has no subscribers, then the effect of Publish MAY be either of: * It is dropped and the topic is nonexistent. * It is accepted to the topic as the next message. Publish() does not wait for subscribers to accept. It returns Ok upon accepting the topic value. It also returns Ok if there are no subscribers and the value happens to be dropped. Publish() can not guarantee delivery in theory but in practice it should almost always deliver to subscribers. REQUIRES HEADER authorization: Momento auth token
public void subscribe(_SubscriptionRequest request, io.grpc.stub.StreamObserver<_SubscriptionItem> responseObserver)
Subscribe to notifications from a topic. You will receive a stream of values and (hopefully occasional) discontinuities. Values will appear as copies of the payloads you Publish() to the topic. REQUIRES HEADER authorization: Momento auth token