本文整理匯總了Golang中github.com/cloudfoundry/noaa/consumer.Consumer.SetIdleTimeout方法的典型用法代碼示例。如果您正苦於以下問題:Golang Consumer.SetIdleTimeout方法的具體用法?Golang Consumer.SetIdleTimeout怎麽用?Golang Consumer.SetIdleTimeout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry/noaa/consumer.Consumer
的用法示例。
在下文中一共展示了Consumer.SetIdleTimeout方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
})
Describe("FirehoseWithoutReconnect", func() {
var (
incomings <-chan *events.Envelope
streamErrors <-chan error
idleTimeout time.Duration
)
BeforeEach(func() {
incomings = make(chan *events.Envelope)
startFakeTrafficController()
})
JustBeforeEach(func() {
cnsmr.SetIdleTimeout(idleTimeout)
incomings, streamErrors = cnsmr.FirehoseWithoutReconnect("subscription-id", authToken)
})
Context("when there is no TLS Config or consumerProxyFunc setting", func() {
Context("when the connection can be established", func() {
It("receives messages from the full firehose", func() {
fakeHandler.Close()
Eventually(fakeHandler.GetLastURL).Should(ContainSubstring("/firehose/subscription-id"))
})
Context("with a message", func() {
BeforeEach(func() {
fakeHandler.InputChan <- marshalMessage(createMessage("hello", 0))
})