lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hi, Rici

I guess you are Lua certified, aren't you :P
just a joke! :)

>c:setopt("writefunction", function...
>c:setopt("writedata", ..

>local c ="url", url)
>                       :setopt("connecttimeout", 15)

I got your point, also what do you think about
or the sugar c.writefunction=function..

and guess how could become if c.__newindex returns self!


Bad idea : ), also I'm not sure if possible

Anyway, your remark is a good point.

>Actually, though, there is a good argument for a different type
>of binding for the writefunction/writedata options. A more
>Lua-like binding would be similar to LuaLDAP, where the perform
>function returns a generator (a "future", if you prefer), and
>the caller can do whatever they want with the resulting strings.

>   for chunk in c:perform() do
>     table.insert(chunks, chunk)
>   end  

But you know that always when there is a data stream there is a 
problem "who is pushing, who is pulling".
I mean the function returned by c:perform() will "pull" data from curl. But actually curl "push" the data through a callback.

Anyway, this is another good point to think about

> c:perform();
> c:close();
>I presume the garbage collector would take care of closing?

>Thanks, again. Looks like it will be very useful.

I thanks for the good remarks.

Get your free email at