What is Nostr?
Rob Napier /
npub1w6g…jdnq
2024-02-08 04:07:47
in reply to nevent1q…w2gn

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).
Author Public Key
npub1w6g6g7yagvqkescw2e5kl2cyasksfgjc3nkky5u90zyypnhcpzxqy8jdnq