On Wed, Oct 18, 2023 at 9:55 PM SuperTXT Team <supertxt...@gmail.com> wrote:
> I'm experimenting with shiny, trying to develop a wire protocol for
> it. I have some questions about the interfaces.
>
> It seems from some of the examples in the documentation and some
> tutorials that everything except perhaps sending custom window events
> (to trigger updates to the UI) occur on a single event loop goroutine,
> which is the same one that the driver's Main function runs in. This
> isn't spelled out in the screen interfaces, so I wonder if this is
> really a true constraint.
>
> If this is true, then how does one handle multiple active windows? The
> window.NextEvent() is blocking, and isn't a channel that permits
> selecting on multiple windows at once.
>
> Otherwise, if it's expected that in some scenarios, such as multiple
> windows, that there will be more goroutines what sorts of permissible
> goroutine configurations are allowed? Can I have a goroutine per
> window, or can any goroutine access anything at any time?

It's been a long time, so I can't remember all of the details, but I
think you can have goroutine per window. Grepping the
golang.org/x/exp/shiny/driver/*driver code for sync.Mutex gives
multiple hits.

You're right that the docs aren't helpful here. However, we were all
re-assigned from shiny (to working on other things) well before shiny
hit anything close to a "1.0 quality" milestone. And the initial focus
was on the single-window use case. For example, on mobile, you
couldn't even have multiple windows. All of the shiny/example programs
use a single window. I wouldn't be surprised if trying to use multiple
shiny windows doesn't work very well.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOeFMNV%2Bx-9fZ-X88rNfT_20_%3D9LCwnhOx0%3DgtSkm9-DXChHzA%40mail.gmail.com.

Reply via email to