Re:Comparing Elixir and Go
by julienmarie on Friday January 27, 2017 @12:45PM
(#13501259)
A simple GenServer ( a OTP behaviour ) linked to an ETS ( erlang in memory data store ) table would do the trick. Basically, It receives by message the inserts, and once the counter reaches x or timer reaches y secs, it inserts in the db. Thinking about it, 20 lines of code is already a bit verbose for it :)
In Elixir, you can use GenStage.
(In fact, I'm writing a GenStage consumer right now.)
Re:Comparing Elixir and Go
by julienmarie on Friday January 27, 2017 @09:13PM
(#13504416)
True. But haven't played with it yet. It seems nice and straightforward also.
Can you provide more details on this? AMQP is pretty recent and people have been batching SQL inserts for much longer than it has been around. An external queue is not a requirement of non-Erlang languages, but I'm curious about specifically about how the implementation in Erlang would substantially differ/allow new approaches from that in other languages.