Rob Napier on Nostr: npub1sy696…g5dxr Cocoa does that with a blocking RunLoop, and it’s basically same ...
npub1sy696clgjzaqm2cg92dy0fvuf0m3kr0kn4f4yqlam0fpy03lfdsqpg5dxr (npub1sy6…5dxr) Cocoa does that with a blocking RunLoop, and it’s basically same in Go. I had lots of them. “while true, select …”
To delay, you use an anonymous “go func()” that first calls time.Sleep before sticking the message on the chan.
You can even pass func’s/closures on the chan if you want to run arbitrary things. Together with a delayer, it’s pretty close to run loops and dispatch (though I usually made them more strongly typed rather than passing arbitrary funcs).
To delay, you use an anonymous “go func()” that first calls time.Sleep before sticking the message on the chan.
You can even pass func’s/closures on the chan if you want to run arbitrary things. Together with a delayer, it’s pretty close to run loops and dispatch (though I usually made them more strongly typed rather than passing arbitrary funcs).