You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by cs...@apache.org on 2022/06/24 03:31:03 UTC
[rocketmq-client-go] branch push_consumer_opti_apache created (now 8cd983d)
This is an automated email from the ASF dual-hosted git repository.
cserwen pushed a change to branch push_consumer_opti_apache
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-go.git
at 8cd983d add some method for pushConsumer
This branch includes the following new commits:
new 8cd983d add some method for pushConsumer
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[rocketmq-client-go] 01/01: add some method for pushConsumer
Posted by cs...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
cserwen pushed a commit to branch push_consumer_opti_apache
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-go.git
commit 8cd983d2e225750fdb3caa8a77281a42bee792a7
Author: dengzhiwen1 <de...@xiaomi.com>
AuthorDate: Fri Jun 24 11:26:08 2022 +0800
add some method for pushConsumer
---
api.go | 6 ++++++
consumer/push_consumer.go | 8 ++++++++
2 files changed, 14 insertions(+)
diff --git a/api.go b/api.go
index 8d6d781..4dd05aa 100644
--- a/api.go
+++ b/api.go
@@ -65,6 +65,12 @@ type PushConsumer interface {
// Unsubscribe a topic
Unsubscribe(topic string) error
+
+ // Suspend the consumption
+ Suspend()
+
+ // Resume the consumption
+ Resume()
}
func NewPushConsumer(opts ...consumer.Option) (PushConsumer, error) {
diff --git a/consumer/push_consumer.go b/consumer/push_consumer.go
index 4ad5ee3..37b1f4a 100644
--- a/consumer/push_consumer.go
+++ b/consumer/push_consumer.go
@@ -255,6 +255,14 @@ func (pc *pushConsumer) Unsubscribe(topic string) error {
return nil
}
+func (pc *pushConsumer) Suspend() {
+ pc.suspend()
+}
+
+func (pc *pushConsumer) Resume() {
+ pc.resume()
+}
+
func (pc *pushConsumer) Rebalance() {
pc.defaultConsumer.doBalance()
}