In Erlang/Elixir, what are some use cases for opening a port with file descriptors?

624 Views Asked by At

I've been poking around the Port module in Elixir, and discovered you can open ports by specifying file descriptors. Examples...

# elixir
iex(1)> Port.open({:fd, 5, 10}, [])
#Port<0.1205>

# erlang
1> erlang:open_port({fd, 5, 10}, []). 
#Port<0.435>

What's a use case for opening a port this way? And do you interact with the port? The documentation for Erlang ports is pretty light, and I haven't found anything talking about ports & file descriptors.

0

There are 0 best solutions below