
Communicate Between Ruby and Elixir Using Erlang Ports and Erlectricity - fazibear
https://blog.fazibear.me/elixir-ruby-dont-fight-talk-with-erlectricity-dbf3af67d999#.xkq935iwh
======
phamilton
The published erlectrcity gem does not support maps, as they were only
introduced into the language in 2013.

I forked it a while back to add support for maps. I'd recommend you use the
fork:
[https://github.com/hamiltop/erlectricity](https://github.com/hamiltop/erlectricity)

------
themgt
We have a couple legacy Rails <-> Elixir apps being slow-ported forward (low
hanging fruit first). The real winner so far for us has been Exq [1], which is
a Sidekiq-compatible job library.

What that means is you can selectively receive jobs in Elixir (e.g. high-perf
Phoenix websocket/request handler) and process them in legacy Ruby Sidekiq
workers when needed, or vice-versa use Elixir to process jobs whose functions
you've ported forward.

If your Rails app is already setup use Sidekiq background jobs, I think this
method is much-preferable to these direct communication libraries.

[1] [https://github.com/akira/exq](https://github.com/akira/exq)

------
nullstyle
Wow. It's crazy to think erlectricity is still kicking. That was one of my
first open source projects, although to be fair mojombo has basically replaced
everything I wrote with far better code over the years.

------
arcaster
I understand why the Ruby community has warmed up to Elixir and the Phoenix
web-framework, however, I'm curious what the advantage or use-case of having
Ruby talk to Elixir in an application is?

~~~
brightball
The main use case would be if you had a very mature Ruby library without an
Erlang/Elixir equivalent. I haven't run into much that I personally need that
isn't already available, but there are definitely some gaps that this could
help people jump in the short term.

~~~
mfb2
Agreed. Currently working with a host of legacy ruby projects that we're
slowly migrating to elixir. We've used hack-arounds to leverage the existing
ruby projects up until now. If this library proves to be production-worthy,
it'll be a great bridge for addressing some technical debt.

~~~
nullstyle
Erlectricity, from what I understand, was used extensively in at least one
iteration of github's architecture. It has spent a lot of time in production
deployments.

