5 ms·
Heavy disagree, protocols are just an interface like solution and things that share a common set of functionality can probably benefit from utilizing a protocol
by Grimm1 6y ago
Heavy disagree, protocols are just an interface like solution and things that share a common set of functionality can probably benefit from utilizing a protocol.
GenServers I disagree with you on even more so since they can handle arbitrary messages (handle_info) it makes it a lot easier to do things like run a continuous process that does an action every n seconds as an example and also to handle life cycle messages from other processes. Oh my downstream consumer says things are finished handle a message that cleans up the children processes and shuts down the supervisor so we don't keep polling.
I use them to great effect in web crawling as a producer for things like Broadway and things like Agent or Task don't have the flexibility at the level I need it.
- deleted 6y ago[deleted]