Re: [go-nuts] Multiple Goroutine timeout

2017-10-25 Thread desaiabhijit
Thanks for the reply How to gather all the values into CH and return to print Thanks On Wednesday, October 25, 2017 at 7:41:34 PM UTC+5:30, M. Shulhan wrote: > > On Wed, 25 Oct 2017 06:30:09 -0700 (PDT) > desaia...@gmail.com wrote: > > > I am expecting to show url1 (2 sec ), url2 (4 sec ) bu

Re: [go-nuts] Multiple Goroutine timeout

2017-10-25 Thread Shulhan
On Wed, 25 Oct 2017 06:30:09 -0700 (PDT) desaiabhi...@gmail.com wrote: > I am expecting to show url1 (2 sec ), url2 (4 sec ) but not url3( 6 > sec) where timeout is 5 sec > > but program showing only url1 value > > Please help > > https://play.golang.org/p/aMOoSEHjmZ > > Thanks in advance > >

Re: [go-nuts] Multiple Goroutine timeout

2017-10-25 Thread Ian Lance Taylor
As far as I can see your GetUrlValues function only ever prints one string. Ian On Wed, Oct 25, 2017 at 6:30 AM, wrote: > I am expecting to show url1 (2 sec ), url2 (4 sec ) but not url3( 6 sec) > where timeout is 5 sec > > but program showing only url1 value > > Please help > > https://play.go

[go-nuts] Multiple Goroutine timeout

2017-10-25 Thread desaiabhijit
I am expecting to show url1 (2 sec ), url2 (4 sec ) but not url3( 6 sec) where timeout is 5 sec but program showing only url1 value Please help https://play.golang.org/p/aMOoSEHjmZ Thanks in advance Rgds, Abhi package main import "fmt" import "time" func InvokeUrl1(u string, val chan<- s

Re: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread desaiabhijit
gnal. You won’t need > to worry about this in the “timeout” case. > > > > John > > John Souvestre - New Orleans LA > > > > *From:* John Souvestre [mailto:jo...@souvestre.com ] > *Sent:* 2017 January 08, Sun 07:27 > *To:* 'golang-nuts' &

Re: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread Sairam Kunala
The ran the code on play, seems to come out within 2 seconds. https://play.golang.org/p/yZIAvXI8IX On Sun, Jan 8, 2017 at 12:53 PM, wrote: > > Can you please help to correct below program where timeout not seems > working > > Work 1 - have 1 second > Work 2 - have 3 second > Total Timeout - 2 s

RE: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread John Souvestre
...@souvestre.com] Sent: 2017 January 08, Sun 07:27 To: 'golang-nuts' Subject: RE: [go-nuts] Multiple goroutine timeout for waitgroup not working Hi Abhi. I’m thinking something like this might do the job. Call monitorWorker(wg, done) as a goroutine and change it to do just the wg.Wait t

RE: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread John Souvestre
desaiabhi...@gmail.com] Sent: 2017 January 08, Sun 07:10 To: John Souvestre Cc: golang-nuts Subject: Re: [go-nuts] Multiple goroutine timeout for waitgroup not working Hi John Can you please help me to apply correct logic to achieve it Haven't found any solution on the net. All articles are

Re: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread desaiabhijit
; Sent: 2017 January 08, Sun 06:24 > To: golang-nuts > Subject: Re: [go-nuts] Multiple goroutine timeout for waitgroup not working > > hi John > > I am expecting work2 should not include in > > headers = <-messgesResponse > > so output of

RE: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread John Souvestre
: Re: [go-nuts] Multiple goroutine timeout for waitgroup not working hi John I am expecting work2 should not include in headers = <-messgesResponse so output of below should be Len = 1 and should print only work 1 only and not 2 ( as work 2 is timed out ) fmt.Pri

Re: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread desaiabhijit
se, and it is taking place. > > What were you expecting to see? > > John > > John Souvestre - New Orleans LA > > From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On > Behalf Of desaiabhi...@gmail.com > Sent: 2017 January 08, Sun 05:4

Re: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread desaiabhijit
expecting to see? > > > > John > > John Souvestre - New Orleans LA > > > > *From:* golan...@googlegroups.com [mailto: > golan...@googlegroups.com ] *On Behalf Of * > desaia...@gmail.com > *Sent:* 2017 January 08, Sun 05:48 > *To:* golang-nuts > *S

RE: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread John Souvestre
-nuts' Subject: RE: [go-nuts] Multiple goroutine timeout for waitgroup not working Hi Abhi. I believe that the wait group timeout (in monitorWorker) was set to 2 seconds in the code you posted. I put a debugging print in the timeout case, and it is taking place. What were you ex

RE: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread John Souvestre
@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of desaiabhi...@gmail.com Sent: 2017 January 08, Sun 05:48 To: golang-nuts Subject: Re: [go-nuts] Multiple goroutine timeout for waitgroup not working hi John Thanks for the reply sorry I mean Work2 takes => 3 seco

Re: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread desaiabhijit
at you didn’t realize that if Work1 runs > first, then Work2 will block since the channel is full (or until you close > it). > > > > John > > John Souvestre - New Orleans LA > > > > *From:* golan...@googlegroups.com [mailto: > golan...@googlegroups.com ] *On Beha

Re: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread Abhijit Desai
Thanks for the reply Sairam Problem is if I change Work2 time => 3 sec then that work should get timeout but program still returning it func Work2(message chan *TestStruct, wg *sync.WaitGroup, tokenNumber string) { defer wg.Done() v1 := new(TestStruct) v1.Name = tokenNumber time.Sleep(3 * time.

RE: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread John Souvestre
lang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of desaiabhi...@gmail.com Sent: 2017 January 08, Sun 01:23 To: golang-nuts Subject: [go-nuts] Multiple goroutine timeout for waitgroup not working Can you please help to correct below program where timeout not seems working

[go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-07 Thread desaiabhijit
Can you please help to correct below program where timeout not seems working Work 1 - have 1 second Work 2 - have 3 second Total Timeout - 2 sec program wait for entire 3 seconds and return both values rather than value from Work 1 Program > package main import ( "fmt" "time" "sync" ) type