News for hackers. Stuff that matters.
Re:Ergo: Erlang-inspired event driven actor framework in Go by Zambyte on Thursday September 12, 2024 @12:51PM (#41522875)
Notably channels differ from actor mailboxes in that they have a capacity, and can block the sender. Mailboxes cannot block the sender, and they do not have a capacity in theory.
Re:Ergo: Erlang-inspired event driven actor framework in Go by kbolino on Thursday September 12, 2024 @01:04PM (#41523022)
The ordinary send operation blocks if the channel is full (or has no buffer), but you can send (or receive) without ever blocking, if you can accept that the message is dropped instead. It's not the most ergonomic operation, though:

    var sent bool
    select {
        case channel<-message:
            sent = true
        default:
            sent = false
    }
Re:Ergo: Erlang-inspired event driven actor framework in Go by brynb on Thursday September 12, 2024 @01:38PM (#41523379)
with that said it’s quite easy to write an equivalent- https://github.com/redwood/redwood/blob/develop/utils/mailbo...