- event handler name – interface
- callback – implementation
Examples: jQuery, Node.js EventEmitter, Go has callbacks too
With Go, interfaces are satisfied implicitly
- From Go Bootcamp book,
There is no explicit declaration of intent. Implicit interfaces decouple implementation packages from the packages that define the interfaces: neither depends on the other.
- Publisher – puts the message on a queue or channel (an identifier acts as the interface)
- Subscriber – decodes the identifier, then apply logic to it (implementation)