miketheprogrammer / go-thrust

Cross Platform UI Kit powered by Blink/V8/Chromium Content Lib
MIT License
445 stars 34 forks source link

Add Channel capabilities to bindings and return the channel to user #34

Open miketheprogrammer opened 9 years ago

miketheprogrammer commented 9 years ago

User needs to be able to decide if they want to block on a channel or handle the result instantly instead of through a handler. This gives a little too much control and in the current system could lock up your binding, i.e. User creates a Window binding but calls window.move or some other CallWhenDisplayed method, and blocks on the channel, thinking that it will return, however it will not receive until window.show() has been called.

However with the above mentioned, I think with some warning, we should provide this option.

@tehbilly - Feel free to chime in here :)

tehbilly commented 9 years ago

I think that would be best handled either by passing in a channel you'd want to be notified on, or by passing in an instance of the handler that is controlled by the go-thrust system. I like the channel approach, personally, as it's more flexible. I'd honestly have to sit down and try the different implementations in a test to see which made more sense.