mat-hek

mat-hek

Membrane Core Team

How to start_link a GenServer on an arbitrary node

Hi there,

I’d like to start_link a GenServer like this:

:rpc.call(node, GenServer, :start_link, [MyServer, options])

however, this fails, because the server gets linked to some process started by :rpc.call, not to the process that executes the call. How do I solve this?

Most Liked

al2o3cr

al2o3cr

This sounds like exactly the scenario that spawn_request/5 was added to OTP 23 to address.

Last Post!

mat-hek

mat-hek

Membrane Core Team

Yeah, I think this would be done easier by using Node.spawn_link. The intermediary process should also trap exits, otherwise, it won’t be notified about exit with the reason :normal. Also, killing the intermediary process wouldn’t immediately kill the target process, as the exit signal can be trapped when it’s not ‘direct’ - this would have to be worked around if needed. As well as probably a couple more quirks I didn’t think of :stuck_out_tongue:

Where Next?

Popular in Questions Top

vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36654 110
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49084 226
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement