Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add some methods for pushConsumer #849

Merged
merged 1 commit into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 8 additions & 0 deletions consumer/push_consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down