[#1711] Re: open-uri patch, added progress_proc hook — "T. Onoma" <transami@...>

Tanaka Akira:

22 messages 2003/11/19
[#1737] Re: open-uri patch, added progress_proc hook — Mathieu Bouchard <matju@...> 2003/11/23

[#1739] Re: open-uri patch, added progress_proc hook — Mathieu Bouchard <matju@...> 2003/11/23

[#1740] Re: open-uri patch, added progress_proc hook — "T. Onoma" <transami@...> 2003/11/23

On Sunday 23 November 2003 08:26 pm, Mathieu Bouchard wrote:

[#1741] Re: open-uri patch, added progress_proc hook — Mathieu Bouchard <matju@...> 2003/11/23

[#1718] Re: open-uri patch, added progress_proc hook — Elliott Hughes <ehughes@...>

22 messages 2003/11/21
[#1722] Re: open-uri patch, added progress_proc hook — Tanaka Akira <akr@...17n.org> 2003/11/22

In article <AD4480A509455343AEFACCC231BA850F17C434@ukexchange>,

[#1724] Re: open-uri patch, added progress_proc hook — "T. Onoma" <transami@...> 2003/11/22

On Saturday 22 November 2003 04:34 pm, Tanaka Akira wrote:

[#1726] Re: open-uri patch, added progress_proc hook — Tanaka Akira <akr@...17n.org> 2003/11/23

In article <200311221024.05642.transami@runbox.com>,

[#1731] Re: open-uri patch, added progress_proc hook — "T. Onoma" <transami@...> 2003/11/23

On Sunday 23 November 2003 02:24 am, Tanaka Akira wrote:

[#1732] Re: open-uri patch, added progress_proc hook — Tanaka Akira <akr@...17n.org> 2003/11/23

In article <200311230325.21687.transami@runbox.com>,

[#1733] Re: open-uri patch, added progress_proc hook — "T. Onoma" <transami@...> 2003/11/23

On Sunday 23 November 2003 03:10 pm, Tanaka Akira wrote:

[#1750] Re: open-uri patch, added progress_proc hook — Tanaka Akira <akr@...17n.org> 2003/11/24

In article <200311230648.41003.transami@runbox.com>,

[#1759] Re: open-uri patch, added progress_proc hook — Sean E Russell <ser@...> 2003/11/24

On Monday 24 November 2003 03:19, Tanaka Akira wrote:

[#1762] Re: open-uri patch, added progress_proc hook — "Nathaniel Talbott" <nathaniel@...> 2003/11/24

Sean E Russell [mailto:ser@germane-software.com] wrote:

[#1753] gc_sweep under 1.8 ... not syck.so — Richard Kilmer <rich@...>

We still encountered a gc_sweep in our use of Ruby 1.8 on Linux (v8).

16 messages 2003/11/24
[#1754] Re: gc_sweep under 1.8 ... not syck.so — ts <decoux@...> 2003/11/24

>>>>> "R" == Richard Kilmer <rich@infoether.com> writes:

[#1757] Re: gc_sweep under 1.8 ... not syck.so — Richard Kilmer <rich@...> 2003/11/24

Yes, there are several (Ruby) threads working during this gc_sweep.

[#1758] Re: gc_sweep under 1.8 ... not syck.so — ts <decoux@...> 2003/11/24

>>>>> "R" == Richard Kilmer <rich@infoether.com> writes:

[#1763] Re: gc_sweep under 1.8 ... not syck.so — Richard Kilmer <rich@...> 2003/11/24

of course this effects 300 machines ;-)

[#1755] Re: Controlled block variables — Jamis Buck <jgb3@...>

On Mon, 2003-11-24 at 02:04, T. Onoma wrote:

26 messages 2003/11/24
[#1756] Re: Controlled block variables — "T. Onoma" <transami@...> 2003/11/24

On Monday 24 November 2003 05:22 pm, Jamis Buck wrote:

[#1760] Re: Controlled block variables — Sean E Russell <ser@...> 2003/11/24

On Monday 24 November 2003 11:51, T. Onoma wrote:

[#1761] Re: Controlled block variables — "T. Onoma" <transami@...> 2003/11/24

On Monday 24 November 2003 06:40 pm, Sean E Russell wrote:

Re: open-uri patch, added progress_proc hook

From: Tanaka Akira <akr@...17n.org>
Date: 2003-11-15 04:33:01 UTC
List: ruby-core #1682
In article <E1AKrZK-00059j-Kd@odie.runbox.com>,
  "T. Onoma" <transami@runbox.com> writes:

> could you show example? hmm...wouldn't the expected length be in the proc already if it were needed? that's what i did with my progressbar.

For example:

% ruby -rlib/open-uri -e 'open("http://www.ruby-lang.org/en/",:progress_proc => lambda {|pos, total| p [pos, total]})'
[720, 15324]
[1144, 15324]
...
[15200, 15324]
[15324, 15324]

If Content-Length is not given:

% ruby -rlib/open-uri -e 'open("http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/",:progress_proc => lambda {|pos, total| p [pos, total]})'
[837, nil]
...
[5534, nil]

But http://www.ruby-lang.org/ reminds me redirection.

% ruby -rlib/open-uri -e 'open("http://www.ruby-lang.org/",:progress_proc => lambda {|pos, total| p [pos, total]})'
[242, nil]
[232, nil]
[720, 15324]
[1144, 15324]
...
[15200, 15324]
[15324, 15324]

First two lines which total is nil are about redirection response.
Hm.  It shouldn't be called with this interface.

But it may mean this interface is not so nice...

Anyone have idea?

> ugh, my typo. what i meant was:
>
>   open(url, {:pos => proc {|b| ...}})
>
> so that if, method_key = :pos and progress_prco = proc {|b| ...}
>
> would end up something like
>
>   ...
>       http.get(uri.to_s, header) { |str|
>           buf << str
>           progress_proc.call(buf.io.method(method_key).call) if progress_proc
>         }
>       }
>   ...
>
>
> but maybe that's too odd?

I don't like that.

* It's too generic without use cases.
* It may conflict with other options in future.
-- 
Tanaka Akira

In This Thread

Prev Next