Using Task.Supervisor to call remote nodes

We have two applications on separate nodes that need to talk to each other. I’ve looked at various options and went through “OTP Distribution” on Elixir School and came to the conclusion that calling nodes via Task.Supervisor seems to be the way to go. Is that correct? Is this a common way of doing this?

I’m curious if there are other things that I need to consider before going down this path.

Here’s what calling a remote node would look like.

{RemoteTaskSupervisor, remote_node}
|> Task.Supervisor.async(RemoteModule, :add, [1, 2])
|> Task.await()

Yes, that works, but it’s not special to Task.Supervisor. As long as the processes that need to communicate run on nodes that are part of the same cluster, they can communicate even with a simple send/2. You can address processes with their pid, local or remote, or with {registered_name, node}.

What’s specifically your doubt?