You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm playing with the "spawn request" feature (introduced in OTP 23) and didn't get the behavior.
On any SPAWN_REQUEST I receive SPAWN_REPLY with a pid. Even if I use random names for the "module" and/or "function" it returns a pid. I was expected to see an error on the failure of spawning. How can I ensure that the PID I'm receiving is a PID of the real process? not the fake one.
There are no details about that in the docs.
The text was updated successfully, but these errors were encountered:
Why do you need to know that? The only way to know that the process successfully started is by it sending a message back to you or if you monitor/link to it.
Thanks for your report! This is the intended behavior. The process won't crash until it tries to run the bogus MFA that you have specified, which it cannot do until it has been successfully spawned. In interactive mode it will also attempt to load the module in question, which may or may not succeed, and we cannot hold off on SPAWN_REPLY for that.
As @garazdawi mentioned, if you want to know how things went after the process was spawned, either have it send a message or monitor/link it.
I'm playing with the "spawn request" feature (introduced in OTP 23) and didn't get the behavior.
On any SPAWN_REQUEST I receive SPAWN_REPLY with a pid. Even if I use random names for the "module" and/or "function" it returns a pid. I was expected to see an error on the failure of spawning. How can I ensure that the PID I'm receiving is a PID of the real process? not the fake one.
There are no details about that in the docs.
The text was updated successfully, but these errors were encountered: