Skip to content

Instantly share code, notes, and snippets.

@GusGA
Last active July 10, 2018 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GusGA/e7486cd81e2564529bad461dfd62c61f to your computer and use it in GitHub Desktop.
Save GusGA/e7486cd81e2564529bad461dfd62c61f to your computer and use it in GitHub Desktop.
Posible Erlang test questions

When Link to or monitor a erlang process

Link

  • Have a dependency on a process (i.e: you can't run if a specific process dies). This fits great into supervisor trees.
  • Have a bidirectional dependency, where a parent can't run if the child dies, and you also want to kill the child if the parent dies in turn.
  • Only need 1 link between processes (remember that if A and B are linked, all subsequent calls to link/2 will be ignored).
  • You are a supervisor, or you want some kind of physical relationship between your processes in your architecture (i.e: you actually need to die or restart or try something out to fix the situation that led to the death of your child.

Monitor

  • Just want to know if a specific process is running, but it's ok for you to continue execution without it (i.e: you can just send an alarm and keep going).
  • Don't need a bidirectional relation (i.e: you want A to know about B dying but you don't need B to know about A).
  • You are an external process, just interested in the faith of a particular process
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment