pub struct SubscriberClient { /* private fields */ }Implementations§
Source§impl SubscriberClient
impl SubscriberClient
Sourcepub fn new(
cm: ConnectionManager,
streaming_pull_cm: ConnectionManager,
) -> SubscriberClient
pub fn new( cm: ConnectionManager, streaming_pull_cm: ConnectionManager, ) -> SubscriberClient
create new Subscriber client
Sourcepub async fn create_subscription(
&self,
req: Subscription,
retry: Option<RetrySetting>,
) -> Result<Response<Subscription>, Status>
pub async fn create_subscription( &self, req: Subscription, retry: Option<RetrySetting>, ) -> Result<Response<Subscription>, Status>
create_subscription creates a subscription to a given topic. See the [resource name rules] (https://cloud.google.com/pubsub/docs/admin#resource_names (at https://cloud.google.com/pubsub/docs/admin#resource_names)). If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn’t exist, returns NOT_FOUND.
If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic, conforming to the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names (at https://cloud.google.com/pubsub/docs/admin#resource_names)). The generated name is populated in the returned Subscription object. Note that for REST API requests, you must specify a name in the request.
Sourcepub async fn update_subscription(
&self,
req: UpdateSubscriptionRequest,
retry: Option<RetrySetting>,
) -> Result<Response<Subscription>, Status>
pub async fn update_subscription( &self, req: UpdateSubscriptionRequest, retry: Option<RetrySetting>, ) -> Result<Response<Subscription>, Status>
updateSubscription updates an existing subscription. Note that certain properties of a subscription, such as its topic, are not modifiable.
Sourcepub async fn get_subscription(
&self,
req: GetSubscriptionRequest,
retry: Option<RetrySetting>,
) -> Result<Response<Subscription>, Status>
pub async fn get_subscription( &self, req: GetSubscriptionRequest, retry: Option<RetrySetting>, ) -> Result<Response<Subscription>, Status>
get_subscription gets the configuration details of a subscription.
Sourcepub async fn list_subscriptions(
&self,
req: ListSubscriptionsRequest,
retry: Option<RetrySetting>,
) -> Result<Vec<Subscription>, Status>
pub async fn list_subscriptions( &self, req: ListSubscriptionsRequest, retry: Option<RetrySetting>, ) -> Result<Vec<Subscription>, Status>
list_subscriptions lists matching subscriptions.
Sourcepub async fn delete_subscription(
&self,
req: DeleteSubscriptionRequest,
retry: Option<RetrySetting>,
) -> Result<Response<()>, Status>
pub async fn delete_subscription( &self, req: DeleteSubscriptionRequest, retry: Option<RetrySetting>, ) -> Result<Response<()>, Status>
delete_subscription deletes an existing subscription. All messages retained in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription or its topic unless the same topic is specified.
Sourcepub async fn modify_ack_deadline(
&self,
req: ModifyAckDeadlineRequest,
retry: Option<RetrySetting>,
) -> Result<Response<()>, Status>
pub async fn modify_ack_deadline( &self, req: ModifyAckDeadlineRequest, retry: Option<RetrySetting>, ) -> Result<Response<()>, Status>
ModifyAckDeadline modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted. Note that this does not modify the subscription-level ackDeadlineSeconds used for subsequent messages.
Sourcepub async fn acknowledge(
&self,
req: AcknowledgeRequest,
retry: Option<RetrySetting>,
) -> Result<Response<()>, Status>
pub async fn acknowledge( &self, req: AcknowledgeRequest, retry: Option<RetrySetting>, ) -> Result<Response<()>, Status>
acknowledge acknowledges the messages associated with the ack_ids in the AcknowledgeRequest. The Pub/Sub system can remove the relevant messages from the subscription.
Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error.
Sourcepub async fn pull(
&self,
req: PullRequest,
retry: Option<RetrySetting>,
) -> Result<Response<PullResponse>, Status>
pub async fn pull( &self, req: PullRequest, retry: Option<RetrySetting>, ) -> Result<Response<PullResponse>, Status>
pull pulls messages from the server. The server may return UNAVAILABLE if there are too many concurrent pull requests pending for the given subscription.
Sourcepub async fn streaming_pull(
&self,
req: StreamingPullRequest,
ping_receiver: Receiver<bool>,
retry: Option<RetrySetting>,
) -> Result<Response<Streaming<StreamingPullResponse>>, Status>
pub async fn streaming_pull( &self, req: StreamingPullRequest, ping_receiver: Receiver<bool>, retry: Option<RetrySetting>, ) -> Result<Response<Streaming<StreamingPullResponse>>, Status>
streaming_pull establishes a stream with the server, which sends messages down to the client. The client streams acknowledgements and ack deadline modifications back to the server. The server will close the stream and return the status on any error. The server may close the stream with status UNAVAILABLE to reassign server-side resources, in which case, the client should re-establish the stream. Flow control can be achieved by configuring the underlying RPC channel.
Sourcepub async fn modify_push_config(
&self,
req: ModifyPushConfigRequest,
retry: Option<RetrySetting>,
) -> Result<Response<()>, Status>
pub async fn modify_push_config( &self, req: ModifyPushConfigRequest, retry: Option<RetrySetting>, ) -> Result<Response<()>, Status>
modify_push_config modifies the PushConfig for a specified subscription.
This may be used to change a push subscription to a pull one (signified by an empty PushConfig) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the PushConfig.
Sourcepub async fn get_snapshot(
&self,
req: GetSnapshotRequest,
retry: Option<RetrySetting>,
) -> Result<Response<Snapshot>, Status>
pub async fn get_snapshot( &self, req: GetSnapshotRequest, retry: Option<RetrySetting>, ) -> Result<Response<Snapshot>, Status>
get_snapshot gets the configuration details of a snapshot. Snapshots are used in Seek (at https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot
Sourcepub async fn list_snapshots(
&self,
req: ListSnapshotsRequest,
retry: Option<RetrySetting>,
) -> Result<Vec<Snapshot>, Status>
pub async fn list_snapshots( &self, req: ListSnapshotsRequest, retry: Option<RetrySetting>, ) -> Result<Vec<Snapshot>, Status>
list_snapshots lists the existing snapshots. Snapshots are used in Seek (at https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.
Sourcepub async fn create_snapshot(
&self,
req: CreateSnapshotRequest,
retry: Option<RetrySetting>,
) -> Result<Response<Snapshot>, Status>
pub async fn create_snapshot( &self, req: CreateSnapshotRequest, retry: Option<RetrySetting>, ) -> Result<Response<Snapshot>, Status>
create_snapshot creates a snapshot from the requested subscription. Snapshots are used in Seek (at https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. If the snapshot already exists, returns ALREADY_EXISTS. If the requested subscription doesn’t exist, returns NOT_FOUND. If the backlog in the subscription is too old – and the resulting snapshot would expire in less than 1 hour – then FAILED_PRECONDITION is returned. See also the Snapshot.expire_time field. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription, conforming to the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names (at https://cloud.google.com/pubsub/docs/admin#resource_names)). The generated name is populated in the returned Snapshot object. Note that for REST API requests, you must specify a name in the request.
Sourcepub async fn update_snapshot(
&self,
req: UpdateSnapshotRequest,
retry: Option<RetrySetting>,
) -> Result<Response<Snapshot>, Status>
pub async fn update_snapshot( &self, req: UpdateSnapshotRequest, retry: Option<RetrySetting>, ) -> Result<Response<Snapshot>, Status>
update_snapshot updates an existing snapshot. Snapshots are used in Seek (at https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.
Sourcepub async fn delete_snapshot(
&self,
req: DeleteSnapshotRequest,
retry: Option<RetrySetting>,
) -> Result<Response<()>, Status>
pub async fn delete_snapshot( &self, req: DeleteSnapshotRequest, retry: Option<RetrySetting>, ) -> Result<Response<()>, Status>
delete_snapshot removes an existing snapshot. Snapshots are used in [Seek] (https://cloud.google.com/pubsub/docs/replay-overview (at https://cloud.google.com/pubsub/docs/replay-overview)) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. When the snapshot is deleted, all messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new one may be created with the same name, but the new one has no association with the old snapshot or its subscription, unless the same subscription is specified.
pub async fn seek( &self, req: SeekRequest, retry: Option<RetrySetting>, ) -> Result<Response<SeekResponse>, Status>
Trait Implementations§
Source§impl Clone for SubscriberClient
impl Clone for SubscriberClient
Source§fn clone(&self) -> SubscriberClient
fn clone(&self) -> SubscriberClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SubscriberClient
impl !RefUnwindSafe for SubscriberClient
impl Send for SubscriberClient
impl Sync for SubscriberClient
impl Unpin for SubscriberClient
impl !UnwindSafe for SubscriberClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request