pprzetacznik / IElixir

Jupyter's kernel for Elixir programming language
Apache License 2.0
357 stars 44 forks source link

Can I start notebook just like "iex -S mix" #43

Closed scottming closed 5 years ago

scottming commented 5 years ago

image Then I can import my module to test my code in notebook, how to do this?

pprzetacznik commented 5 years ago

Hi @scottming,

if I understand what you're trying to do then I think it's possible. When I debug IElixir and want to achieve something like iex -S mix, I follow these steps: https://railsware.com/blog/2014/03/26/interconnecting-elixir-nodes/

I set cookie and node's name in start_script.sh by replacing following line:

ELIXIR_ERL_OPTIONS="-smp enable" CONNECTION_FILE=$1 mix run --no-halt

with that line:

ELIXIR_ERL_OPTIONS="-smp enable" CONNECTION_FILE=$1 iex --sname ielixir_node --cookie ielixir_token -S mix run --no-halt

so my node is named from now and I can connect to it by name and using the cookie following steps from above article. I activate Job Control Mode, list all jobs and connect to the one I need with: c [number of the job I want to connect]. Then I have the thing you need.

scottming commented 5 years ago

Hi, @pprzetacznik , I have read the article, but how do I switch to JCL in notebook? CTRL + G not work. Yes, I want to debug with IElixir.

pprzetacznik commented 5 years ago

Hi, @scottming,

I'm using this approach only for debugging IElixir from external terminal. I run one terminal IElixir having cookies set and the second that I use for connecting to and debugging the IElixir's process. Debugging processes from inside of IElixir is not yet available ;_;