[go-nuts] Re: Close a reader to quit a loop without closing its source

2016-09-02 Thread mhhcbon
thanks a lot !! It is very much appreciated. The for loop is *very* clever. Le vendredi 2 septembre 2016 16:30:21 UTC+2, Alan Donovan a écrit : > > On 2 September 2016 at 06:21, mhhcbon > > wrote: > >> I dig into the repo you mentioned, TBHonnest, im not that wise, and it >> remains unclear. >>

[go-nuts] Re: Close a reader to quit a loop without closing its source

2016-09-02 Thread 'Alan Donovan' via golang-nuts
On 2 September 2016 at 06:21, mhhcbon wrote: > I dig into the repo you mentioned, TBHonnest, im not that wise, and it > remains unclear. > For the few i know, select is the approach to take, but the API is unclear. > > Not sure if it s possible to come up with something as straight as > `NewReade

[go-nuts] Re: Close a reader to quit a loop without closing its source

2016-09-02 Thread mhhcbon
I dig into the repo you mentioned, TBHonnest, im not that wise, and it remains unclear. For the few i know, select is the approach to take, but the API is unclear. Not sure if it s possible to come up with something as straight as `NewReader(os.Stdin).Block(false).Read()` Le mercredi 31 août

Re: [go-nuts] Re: Close a reader to quit a loop without closing its source

2016-09-01 Thread adonovan via golang-nuts
On Thursday, 1 September 2016 07:12:59 UTC-4, Aram Hăvărneanu wrote: > > On Wed, Aug 31, 2016 at 11:58 PM, adonovan via golang-nuts > > wrote: > > > > [the POSIX 'select' system call] was the inspiration for the Go > > select statement, but whereas Go's select multiplexes channels, > > POSIX's

Re: [go-nuts] Re: Close a reader to quit a loop without closing its source

2016-09-01 Thread Aram Hăvărneanu
On Wed, Aug 31, 2016 at 11:58 PM, adonovan via golang-nuts wrote: > > [the POSIX 'select' system call] was the inspiration for the Go > select statement, but whereas Go's select multiplexes channels, > POSIX's select multiplexes files. I can't claim any authority over this, but believe it is wron

[go-nuts] Re: Close a reader to quit a loop without closing its source

2016-08-31 Thread adonovan via golang-nuts
On Wednesday, 31 August 2016 07:48:12 UTC-4, Dave Cheney wrote: > > Unfortunately POSIX does not guarantee that close from one thread will > unblock another. To read from a file without waiting longer than a specified time, you need to use the POSIX 'select' system call, which you can find at