Re: timeout reader and writer

137 views
Skip to first unread message

Vasiliy Tolstov

unread,
Nov 25, 2015, 8:19:47 AM11/25/15
to Vasiliy Tolstov, golang-nuts
2015-11-25 14:11 GMT+03:00 Vasiliy Tolstov <v.to...@selfip.ru>:
> Hi!. Does somebody already have timeout reader and writer packages for go?
> I found some on play.golang.org by maybe somebody already write public
> package for this.


Fix the email Subject =)

--
Vasiliy Tolstov,
e-mail: v.to...@selfip.ru

roger peppe

unread,
Nov 25, 2015, 3:10:13 PM11/25/15
to Vasiliy Tolstov, golang-nuts
What are you reading from or writing to? Doing a
decent implementation of a reader or writer timeout
on top of an arbitrary io.Reader or io.Writer is
not possible in general, because it would involve
leaving garbage goroutines around on timeout.

If you're using a network connection, there is support
for timeouts.
> --
> You received this message because you are subscribed to the Google Groups "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Vasiliy Tolstov

unread,
Nov 26, 2015, 1:22:08 AM11/26/15
to roger peppe, golang-nuts
2015-11-25 23:09 GMT+03:00 roger peppe <rogp...@gmail.com>:
> What are you reading from or writing to? Doing a
> decent implementation of a reader or writer timeout
> on top of an arbitrary io.Reader or io.Writer is
> not possible in general, because it would involve
> leaving garbage goroutines around on timeout.
>
> If you're using a network connection, there is support
> for timeouts.


I'm read and write from/to file descriptor. (returned from epoll_wait)

dja...@gmail.com

unread,
Nov 26, 2015, 2:14:54 AM11/26/15
to golang-nuts, rogp...@gmail.com

Vasiliy Tolstov

unread,
Nov 26, 2015, 2:25:31 AM11/26/15
to dja...@gmail.com, golang-nuts, rogp...@gmail.com
2015-11-26 10:14 GMT+03:00 <dja...@gmail.com>:
> https://groups.google.com/forum/#!topic/golang-nuts/w7Onq7eeSC8
>
> Djadala


Thanks! I'm try to check it.
Reply all
Reply to author
Forward
0 new messages