Skip to content

Commit

Permalink
fix: readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zenghur committed Jun 4, 2020
1 parent b4ca7bd commit e46aa7a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import (
"github.com/xiaojiaoyu100/aliyun-mns/v2"
)

type One struct {
type Builder struct {
}

func (o *One) Handle(ctx context.Context) error {
func (b *Builder) Handle(ctx context.Context) error {
//return alimns.BackoffError{
// Err: err,
// N: 30,
Expand All @@ -40,11 +40,11 @@ func (o *One) Handle(ctx context.Context) error {
//return nil
}

func MakeContext(m *alimns.M) (context.Context, error) {
func Before(m *alimns.M) (context.Context, error) {
return context.TODO(), nil
}

func Clean(ctx context.Context) {
func After(ctx context.Context) {
}

func main() {
Expand All @@ -65,14 +65,14 @@ func main() {
return
}

client.SetMakeContext(MakeContext)
client.SetClean(Clean)
client.SetBefore(Before)
client.SetAfter(After)

consumer := alimns.NewConsumer(client)
err = consumer.AddQueue(
&alimns.Queue{
Name: "QueueTest1",
Builder: &One{},
Builder: &Builder{},
},
)
if err != nil {
Expand Down

0 comments on commit e46aa7a

Please sign in to comment.