Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Elixir's System.cmd blocking

I'd like to make a system that pulls github repositories automaticly using

System.cmd("git",["pull", link])

Is this command blocking? If I start it concurrently in many actors will I be always able to get as many pulls as actors (or at least socket limit for the system)?

If not is there anyway to acheive it?

like image 507
Krzysztof Wende Avatar asked Oct 19 '22 09:10

Krzysztof Wende


1 Answers

Erlang and thus Elixir IO is non-blocking, so the IO of one process does not generally affect other processes in any way. Joe Armstrong describes this in a blog post:

So our code “looks like” we’re doing a synchronous blocking read. Looks like was in quotes, because it’s not actually a blocking read, it’s really an asynchronous read which does not block any other Erlang processes.

like image 140
Patrick Oscity Avatar answered Nov 02 '22 04:11

Patrick Oscity