Skip to content

Commit

Permalink
Remove mill router timeouts (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
maclav3 authored Jul 6, 2019
1 parent f82eaee commit 427112c
Show file tree
Hide file tree
Showing 5 changed files with 195 additions and 23 deletions.
15 changes: 8 additions & 7 deletions tools/mill/cmd/consume.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ For the configuration of particular pub/sub providers, see the help for the prov

router.AddPlugin(plugin.SignalsHandler)

out, err := io.NewPublisher(os.Stdout, io.PublisherConfig{
MarshalFunc: io.PayloadMarshalFunc,
})
out, err := io.NewPublisher(
os.Stdout,
io.PublisherConfig{
MarshalFunc: io.PayloadMarshalFunc,
},
logger,
)
if err != nil {
return errors.Wrap(err, "could not create console producer")
}
Expand All @@ -57,10 +61,7 @@ For the configuration of particular pub/sub providers, see the help for the prov
},
)

ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
defer cancel()

return router.Run(ctx)
return router.Run(context.Background())
},
}

Expand Down
1 change: 1 addition & 0 deletions tools/mill/cmd/googlecloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ For the configuration of consuming/producing of the messages, check the help of
googlecloud.PublisherConfig{
ProjectID: projectID(),
},
logger,
)

if err != nil {
Expand Down
18 changes: 9 additions & 9 deletions tools/mill/cmd/produce.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ For the configuration of particular pub/sub providers, see the help for the prov

router.AddPlugin(plugin.SignalsHandler)

in, err := io.NewSubscriber(os.Stdin, io.SubscriberConfig{
PollInterval: time.Second,
UnmarshalFunc: io.PayloadUnmarshalFunc,
Logger: logger,
})
in, err := io.NewSubscriber(
os.Stdin,
io.SubscriberConfig{
PollInterval: time.Second,
UnmarshalFunc: io.PayloadUnmarshalFunc,
},
logger,
)
if err != nil {
return errors.Wrap(err, "could not create console subscriber")
}
Expand All @@ -66,10 +69,7 @@ For the configuration of particular pub/sub providers, see the help for the prov
},
)

ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
defer cancel()

return router.Run(ctx)
return router.Run(context.Background())
},
}

Expand Down
10 changes: 3 additions & 7 deletions tools/mill/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,18 @@ require (
cloud.google.com/go v0.39.0
github.com/DataDog/zstd v1.4.0 // indirect
github.com/Shopify/sarama v1.22.1
github.com/ThreeDotsLabs/watermill v0.4.0
github.com/google/go-cmp v0.3.0 // indirect
github.com/hashicorp/golang-lru v0.5.1 // indirect
github.com/ThreeDotsLabs/watermill v0.4.1-0.20190622135636-f82eaeea68ee
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/kr/pty v1.1.3 // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/pierrec/lz4 v2.0.5+incompatible // indirect
github.com/pkg/errors v0.8.1
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.3
github.com/spf13/viper v1.3.2
golang.org/x/net v0.0.0-20190514140710-3ec191127204 // indirect
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a // indirect
golang.org/x/sync v0.0.0-20190423024810-112230192c58 // indirect
golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f // indirect
golang.org/x/text v0.3.2 // indirect
google.golang.org/appengine v1.6.0 // indirect
google.golang.org/genproto v0.0.0-20190513181449-d00d292a067c // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/yaml.v2 v2.2.2
Expand Down
Loading

0 comments on commit 427112c

Please sign in to comment.