New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Having trouble getting spawn to work in Erlang using Erlide/Eclipse #145
Comments
Could you please be more specific about what is not working? When connecting to an erlang node, erlide is just a different (remote) shell process. There are some issues with printing stuff (sometimes the output goes to the wrong place) and maybe this is what you experience - you spawn a process that prints a text which you don't see in the console. |
Thanks for responding, Vlad! First I tried this tutorial #11 on youtube... http://www.youtube.com/watch?v=AS60CMWSzMQ It is the equivalent of the example shown on page 91, section 4.3.1: Processes of section 4.3: Concurrent Programming of the Erlang/OTP System Documentation that you can download off of the Erlang website. With the youtube tutorial you can see that the results come back to the console. I also tried the example code shown in 4.3.1 with similar result. In both cases, I got no responses on the console and Eclipse/Erlide "locked up" and would not process any further commands until I refreshed the console with a new "Run As" to Erlang. When I refreshed, I could successfully run other parts of the module but not the bit that invoked the spawn option. I had similar, but not identical troubles with tutorial #14 on yoube... http://www.youtube.com/watch?v=IF4Qsxpwzzs The code looks like this... messageRec() -> factorial(Int, Acc) when Int > 0 -> factorialRecorder(Int, Acc, IoDevice) when Int > 0 -> Here, when I spawned... Pid = spawn(fun, easy:messageRec/0). I got a process id like <0.273.0> back like I was supposed to, but when I then tried to invoke either option within messageRec via... Pid ! {factorial,10}. I got no response and the system locked up. I refreshed the Erlang shell and tested both factorial and factorialRecorder separately without messaging and the coding worked properly. That is the problem that I am encountering. Any guidance that you can give that could get me past this problem will be greatly appreciated. Best wishes, Forrest |
Can you run these steps in a regular console? The erlide console doesn't show all error messages and the returned pid is bogus if there was an error (more exactly, the process crashes right after starting). For example the module or function names are misspelled or the module is not accessible. You can call erlang:is_process_alive(Pid) to check that the process is running. The problem has a ticket and the console is next in line to get a makeover. |
I haven't tried yet. That is next on my list of things to do. On Thursday, January 2, 2014 12:34 PM, Vlad Dumitrescu notifications@github.com wrote: Can you run these steps in a regular console? |
I too had the same problem as yours. This (http://stackoverflow.com/questions/22546157/erlang-is-not-returning-anything-with-spawn/22565717#22565717) was the solution for me. Hope this will help others as well. Thank you. |
To make it clearer, the fix will be available in version 0.28. |
I'm a newbie with Erlang working my way through tutorials and am working with Erlang in a Windows environment and Eclipse and the Erlide plug-in. Has anybody using this environment had trouble getting the spawn feature to work?
I get the feeling that there is some sort of setting within Eclipse/Erlide that I needed to have set before starting work. Has anybody run into this problem or have any idea what might be wrong?
It doesn't seem to be a bug within Erlide/Eclipse as such in that this guy gives a tutorial and it works fine.
http://www.youtube.com/watch?v=IF4Qsxpwzzs
This is why I think it is more of a setting issue than a bug in Erlide.
The text was updated successfully, but these errors were encountered: