handling and uploader logic, so the truth is probably somewhere in between
:)
On Wed, Jan 28, 2015 at 10:45 AM, Péter Szilágyi wrote:
That is indeed my solution currently, that's why I said that it's not
*too* complicated to write, but I still miss the functionality from the
libs (though this is a personal opinion, so I can accept not including it).
The dozen-or-so is a hundred-or-so rather, but your point still stands :)
Lastly, of course you could always add specialized intelligent error
handling, but it would be nice to have an easy/dumb way of doing it and
work from there if it's not enough (yes, you could argue, that the dump way
is io.Copy :P).
--That is indeed my solution currently, that's why I said that it's not
*too* complicated to write, but I still miss the functionality from the
libs (though this is a personal opinion, so I can accept not including it).
The dozen-or-so is a hundred-or-so rather, but your point still stands :)
Lastly, of course you could always add specialized intelligent error
handling, but it would be nice to have an easy/dumb way of doing it and
work from there if it's not enough (yes, you could argue, that the dump way
is io.Copy :P).
On Wed, Jan 28, 2015 at 10:40 AM, Jan Mercl wrote:
Feed the upload reading from a channel the download writes to chunks of
data.
It's simple. Wrapping it into a stdlib fn is not worth of it, IMO.
Additionally, such wrapper has no chance to handle network errors in any
intelligent/task specific way* which the roll-your-own dozen-or-so lines
can.
(*) In this case like reestablishing a broken network connection and
continuing from the last good R/W position etc on either/both side(s)
(DL/UL).
-j
On Wed Jan 28 2015 at 9:18:47 Péter Szilágyi wrote:
until you look at the network usage: x1 secs download, y1 secs upload,
x2 secs download, y2 secs upload.
Run the upload and download in separate goroutines, ie. concurrently.until you look at the network usage: x1 secs download, y1 secs upload,
x2 secs download, y2 secs upload.
Feed the upload reading from a channel the download writes to chunks of
data.
It's simple. Wrapping it into a stdlib fn is not worth of it, IMO.
Additionally, such wrapper has no chance to handle network errors in any
intelligent/task specific way* which the roll-your-own dozen-or-so lines
can.
(*) In this case like reestablishing a broken network connection and
continuing from the last good R/W position etc on either/both side(s)
(DL/UL).
-j
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.