go-thrust
go-thrust copied to clipboard
Add Channel capabilities to bindings and return the channel to user
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 :)
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.