rustler icon indicating copy to clipboard operation
rustler copied to clipboard

Expose `enif_is_process_alive`

Open zachallaun opened this issue 2 years ago • 3 comments

Happy to take a shot at adding this if there are no objections.

Edit: just saw #44, where both this and enif_is_current_process_alive are mentioned.

zachallaun avatar May 24 '23 16:05 zachallaun

The function is already in rustler_sys, you just need to add a function on Env in the local_pid module (like the existing pid() function there).

filmor avatar May 24 '23 19:05 filmor

Want to make sure I understand the project structure correctly — would you implement is_process_alive and is_current_process_alive here that operate on the underlying types, and then create the public interface that uses those wrappers here? So when writing a nif you’d use:

env.is_current_process_alive();
env.is_process_alive(pid);

// or should it be
pid.is_process_alive(env);

zachallaun avatar May 26 '23 13:05 zachallaun

Sorry for the late reply. I think I'd like all of these, where of course pid.is_process_alive could just redirect to the implementation on env.

filmor avatar Sep 17 '23 15:09 filmor

Implemented in #599, will be in the next release.

filmor avatar Mar 12 '24 06:03 filmor