On Tue, 2005-08-02 at 16:36 +0200, Dirk Meyer wrote: > I see the problem. But how to you want to raise an exception > asynchronously. Where? In the main loop? Why do you need it? What do > you test in this case? Maybe an exception signal?
Well, let's say there's an error in MPlayer that we want to translate to
an exception. So this exception gets raised inside the notifier loop
(from SocketDispatcher). How can we handle this exception?
I think having an exception signal is too specific. There should be a
more generic way to handle these cases. Consider a thread which raises
a signal that you want to handle in the main thread. Currently you have
an exception callback. We can make a more consistent mechanism for this
kind of thing.
There's also another niggle ...
mp = MPlayer((800,600))
mp.play("foo.avi")
The way it works now, MPlayer constructor loads mplayer and gets some
basic stuff like filter list and input key names. This is a dependency
for play(). I guess in order for all this to be asynchronous, all that
stuff will have to be handled in the notifier callback for the process
with a simple internal state machine keeping track of where things are.
On the other hand, we can cache the values for the filter and keyname
list, so that only needs to be done once. I guess it won't be so bad.
There's still the question of how to properly handle exceptions that
occur from the notifier callbacks.
Jason.
signature.asc
Description: This is a digitally signed message part
