News for hackers. Stuff that matters.
Re:Elixir: Practical Concurrency Cookbook by manusachi on Saturday July 24, 2021 @04:13AM (#27939209)
> One of the strengths of GenServers is that they allow us to spin one up per user very easily, so they don't become a bottleneck where the Agent does.

Agent is a special case of GenServer[1]. With the same luck we could spin up an agent per user.

[1] [Agent.start_link/2](https://github.com/elixir-lang/elixir/blob/9137fd1cb2368bb1b...)

Re:Elixir: Practical Concurrency Cookbook by tylerpachal on Sunday July 25, 2021 @01:37PM (#27951195)
In addition to what the offer recommended in the "Scheduling work" section, using the `:timer.send_interval()` can be useful if you want to do something every X seconds, instead of every X + Y seconds, where Y is the time it takes to process the "work" message.

Also I prefer to use `handle_continue` instead of `schedule_work()` style (which in a lot of cases pre-date the introduction of `handle_continue`).

Re:Elixir: Practical Concurrency Cookbook by sandwichinvest on Sunday July 25, 2021 @04:24PM (#27952606)
Having reliable scheduling in the language itself seems like it would simplify a ton of software that's currently reliant on a lot of message queueing and cron duct tape. Running BEAM in production still scares me, but that's one reason to conquer the fear.
Re:Elixir: Practical Concurrency Cookbook by mattbaker on Sunday July 25, 2021 @04:42PM (#27952755)
I’m always curious to learn about things that make people cautious to run the BEAM in production. What makes it scary for you?
Re:Elixir: Practical Concurrency Cookbook by sandwichinvest on Monday July 26, 2021 @01:37PM (#27962409)
Pure fear of the unknown, combined with fear of getting less-than-stellar tracebacks & profiling because Elixir's only one of the VM languages.
Re:Elixir: Practical Concurrency Cookbook by mattbaker on Monday August 02, 2021 @10:48PM (#28045217)
Makes sense. For what it’s worth we’ve been really happy with traces, no issues there, and there are definitely profiling tools. Plus you can point Erlang’s Observer tool at a production BEAM node, it’s wildly useful!
Re:Elixir: Practical Concurrency Cookbook by dnautics on Sunday July 25, 2021 @10:18PM (#27954852)
NHS and Boston MBTA both run BEAM in production, and arguably lives are at stake there (mostly indirectly but still) ...
Re:Elixir: Practical Concurrency Cookbook by hmmokidk on Sunday July 25, 2021 @06:16PM (#27953439)
You may have done it already through RabbitMQ.

Also I want to comment that it is awesome and I love it. It’s simple and effective. OTP being bundled into the language is really very brilliant.

Re:Elixir: Practical Concurrency Cookbook by atonse on Saturday July 24, 2021 @08:01AM (#27940175)
Regarding caching, after years of not using any, we finally ended up using nebulex (with the in-memory cache) and it’s been excellent.

The ability to add cache annotations to functions feels really clean.

There’s also the ability to have cluster wide state but we haven’t set that up yet. We will soon.

Re:Elixir: Practical Concurrency Cookbook by conradfr on Sunday July 25, 2021 @05:34PM (#27953121)
Nebulex seems interesting, I may be tempted to replace cachex with it.

It also seems a clean way to fill the lack of integrated cache solution in ecto.