Re: lua-factory: the analysis of the changes proposed in #753141



В Ср, 04/11/2015 в 13:00 +0100, Bastien Nocera пишет:
On Thu, 2015-10-29 at 22:40 +0100, Victor Toso wrote:
2. The async methods like grl.fetch can't work without OS, even
though
they don't require them directly. So you can't fetch anything
during
e.g. grl_source_init()

Agreed. Bad design.

Why would you fetch something in the source init? You wouldn't do
that
for a C plugin, I don't see why you would in a Lua source...

Well, I could think of some theoretical usecase, when you want to
download some metadata, and then update it regularly. That would be a
fetch request, that is not directly connected to any particular
operation, and hence shouldn't block it's completion.

But then again, it's just a possibility.

As for the rest of the API changes. I don't mind the internal
changes,
but I'd really like to keep the API changes, and thus the changes to
be
made in the plugins to a minimum.

The rejected patch for appletrailers https://bugzilla.gnome.org/attachm
ent.cgi?id=310361&action=diff can show you the approximate amount of
changes needed for your regular plugin. You may see that they are
trivial.

Also, if you don't update your plugin correctly, it will just instantly
fail to work, no pitfalls.

(I'm not really swayed by one-liner callbacks which don't do any
error
checking for example...)

This example is there just to better explain the nature of the change,
not an encouragement for a one-liner callbacks. Still you can use
anonymous functions as callbacks if it's your thing (if you're in love
with node.js or something)

grl.fetch ("my stuff", function (data)
  -- here we go --
  -- our long and intricate callback --
end)

Cheers,
        George


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