LegitStack

LegitStack

Can an actor framework for Python be implemented by using Elixir erlport?

I have this weird idea. I want to use elixir as a messaging service between python functions across a network.

Luckily, I found this post which explains how to use erlport to call python functions from elixir.

One use case for this sort of thing is as a worker-scheduler type system. But more generally it seems like a cool way to implement an actor system for python - just use an actor language.

My question to you guys is: what’s wrong with this idea? Is it doable? is it doable but difficult?

Keep in mind I’ve never really used erlang or elixir, but I love ideas behind the language. So what might I be missing?

Just so we’re on the same page let me give you a concrete example of how a framework like this could be used:

Say you have a network with 5 computers. 4 powerful machines we’ll call the ‘cluster’ and 1 laptop, we’ll call the ‘scheduler.’

You could start up a genserver (or something, I barely know what that is) so that there are workers on the clusters waiting to pull tasks from some elixir process on the scheduler. The idea is that the users (who only knows python, because lets say they are datascientists) would send a list of python functions to the scheduler using erlpoint, then the workers would pull those functions and execute the python call using erlport until all the tasks were depleted.

Of course, this is not the only use case, but its a simple, functional one.

What do you think?

Most Liked

peerreynders

peerreynders

I think the fundamental question is: what real world problem is being solved by your idea?

Python evolved to solve certain problems in a certain manner in a given environment.

The BEAM with it’s process based nature approaches real world problems in a very different way - a way which is fundamentally at odds with the way libraries implemented in Python (and the lower level C code) operate.

Another Python integration technology which hasn’t been mentioned yet: Pyrlang

kpanic

kpanic

Not sure what you want to do but GitHub - celery/kombu: Messaging library for Python. · GitHub powers celery, you might want to have a look into it to build your own “custom” workers
Since you are curious about erlang/elixir, you might want to try also GitHub - Pyrlang/Pyrlang: Erlang node implemented in Python 3.5+ (Asyncio-based) · GitHub

NOTE that Ask Solem, the author of celery inspired herself from erlang to create celery/kombu.
That’s one of the reasons that pushed me to try/learn erlang/elixir

Nicd

Nicd

Your example sounds a lot like what Celery already does well in Python land. It uses RabbitMQ by default to deal with the task distribution.

Where Next?

Popular in Questions Top

chokchit
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2733ms. You can configure how long re...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Other popular topics Top

albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New

We're in Beta

About us Mission Statement