News for hackers. Stuff that matters.
Re:Comparing Elixir and Go by cookiecaper on Friday January 27, 2017 @12:23PM (#13501099)
>My last example was when I needed to batch sql inserts in an events database. In a normal language I would have needed a queue, the libraries for it, workers, new deployments and infrastructure to monitor, monitoring, supervision, etc... In Elixir, in 20 lines of code, it's done.

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.

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 :)
Re:Comparing Elixir and Go by devbug on Friday January 27, 2017 @02:20PM (#13501880)
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.