On Mon, 27 Jun 2016 06:26:59 -0700 (PDT)
Michael Soulier wrote:
> > Hmm. Maybe I misunderstand how runsv connects the two. A simple
> > shell test seems to behave more as expected. I'll need to dig.
> >
> I think I found it. On read I'm getting "resource temporarily
> unavailable", so I suspect r
On 2016-06-27 11:26 AM, Ian Lance Taylor wrote:
> The golang.org/x/sys/unix package support Poll on GNU/Linux.
For now I'm using select so it works on darwin too. Seems to work so far.
Thanks,
Mike
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" grou
On Mon, Jun 27, 2016 at 6:26 AM, Michael Soulier wrote:
> On Saturday, June 25, 2016 at 9:03:59 PM UTC-4, Michael Soulier wrote:
>>
>> Hmm. Maybe I misunderstand how runsv connects the two. A simple shell test
>> seems to behave more as expected. I'll need to dig.
>>
>
> I think I found it. On rea
On Saturday, June 25, 2016 at 9:03:59 PM UTC-4, Michael Soulier wrote:
>
> Hmm. Maybe I misunderstand how runsv connects the two. A simple shell test
> seems to behave more as expected. I'll need to dig.
>
>
I think I found it. On read I'm getting "resource temporarily unavailable",
so I suspect
On Saturday, June 25, 2016 at 8:53:53 PM UTC-4, Michael Soulier wrote:
>
> Unfortunately not. runsv starts the logger and connects the service's
> stdout to the logger's stdin. It opens this pipe even if the service isn't
> up yet, so when you read from stdin, it immediately returns with an EOF,
That doesn't sound right. Reading from a pipe should only get EOF when the
other side of the pipe is closed.
On Sunday, 26 June 2016 10:53:53 UTC+10, Michael Soulier wrote:
>
> On Saturday, June 25, 2016 at 4:19:34 PM UTC-4, Janne Snabb wrote:
>>
>> You should not be using select in the first pla
On Saturday, June 25, 2016 at 4:19:34 PM UTC-4, Janne Snabb wrote:
>
> You should not be using select in the first place. You are making things
> complicated for no reason whatsoever. (If I understand your intention
> correctly.)
>
> You should just read from os.Stdin. It will block until there
On 2016-06-25 22:59, Michael Soulier wrote:
> I'm curious as to what I'm doing wrong with select here, and if it's
> possible to do this with a goroutine like you describe.
You should not be using select in the first place. You are making things
complicated for no reason whatsoever. (If I understa
On Saturday, June 25, 2016 at 11:31:57 AM UTC-4, Jessta wrote:
>
> You'll only get an EOF if the file descriptor has been closed, if it's
> closed then you're not going to be able to read anything more anyway.
>
> What are you trying to do?
>
I'm trying to write a replacement for svlogd from th
On 25 Jun 2016 11:08 p.m., "Michael Soulier" wrote:
>
> Sure, but when you read and get an EOF you return immediately, so the
goroutine would be busy waiting when there's nothing to read, would it not?
>
You'll only get an EOF if the file descriptor has been closed, if it's
closed then you're not
On Friday, June 24, 2016 at 6:59:28 PM UTC-4, Ian Lance Taylor wrote:
>
> In Go you normally simply start a goroutine that reads from Stdin and
> sends the data over a channel.
>
> Goroutines are cheap.
>
>
Sure, but when you read and get an EOF you return immediately, so the
goroutine would
I thought I got select working but now it's returning immediately even
without any input to stdin.
// loop forever - we expect to be killed with a SIGTERM or SIGINT
for {
logger.Debug("going into select on stdin")
var r_fdset syscall.FdSet
for i := 0; i < 16; i++ {
On Friday, June 24, 2016 at 7:10:55 PM UTC-4, graha...@gmail.com wrote:
>
> If you have a specific case that isn't covered by blocking in a
> go-routine, you can always use the syscall's directly, with a very similar
> API to what you would do in C.
>
> For example here's the epoll ones in stdli
If you have a specific case that isn't covered by blocking in a go-routine,
you can always use the syscall's directly, with a very similar API to what
you would do in C.
For example here's the epoll ones in stdlib:
https://golang.org/pkg/syscall/#EpollCreate
New syscall wrappers are in the x/
On Fri, Jun 24, 2016 at 2:44 PM, wrote:
> Unfortunately I don't think this works if you want to do something like poll
> stdin, skipping EOFs in a non-busy-waiting pattern.
>
> A simple poll() in C works fine for this, but I can't figure out how do this
> this in Go because it does not provide a
Unfortunately I don't think this works if you want to do something like
poll stdin, skipping EOFs in a non-busy-waiting pattern.
A simple poll() in C works fine for this, but I can't figure out how do
this this in Go because it does not provide a poll.
Maybe I'm missing something.
Mike
On Thu
16 matches
Mail list logo