koral
2014-11-02 18:33:11 UTC
Hello,
I'm attaching to this mail a commented piece of code that exposes a design issue I'm having.
Basically, I'm trying to separate the code that emits a GUI signal, from the code that handles it.
The issue is that some gtk2hs signals expect a result in return (e.g. Graphics.UI.Gtk.WebKit.WebView.mimeTypePolicyDecisionRequested).
I implemented this through MVar-s, but this creates a deadlock as detailed in the example code.
I'm now wondering:
* was separating emitter and handler in distinct threads a good idea in the first place ? It looks to me that such design would provide a great isolation (e.g. running emitter and handler in separate monads)
* am I right to conclude that it is impossible to implement such design, as suggested by the attached example ?
Thank you in advance for your insights.
--
koral
I'm attaching to this mail a commented piece of code that exposes a design issue I'm having.
Basically, I'm trying to separate the code that emits a GUI signal, from the code that handles it.
The issue is that some gtk2hs signals expect a result in return (e.g. Graphics.UI.Gtk.WebKit.WebView.mimeTypePolicyDecisionRequested).
I implemented this through MVar-s, but this creates a deadlock as detailed in the example code.
I'm now wondering:
* was separating emitter and handler in distinct threads a good idea in the first place ? It looks to me that such design would provide a great isolation (e.g. running emitter and handler in separate monads)
* am I right to conclude that it is impossible to implement such design, as suggested by the attached example ?
Thank you in advance for your insights.
--
koral