@Test public void remoteProcedureCall () throws Exception { val name = createName(); node = Nodes.singleNode(name, NodeConfig.builder() .shortName(true) .cookie("secret") .build()); Mailbox mailbox = node.mailbox().build(); mailbox.call(ELIXIR_ECHO_SERVER, "erlang", "date"); Message message = mailbox.receive(5, SECONDS); assertThat(message.getHeader()) .extracting(ControlMessage::getTag) .isEqualTo(SEND); assertThat(message.getBody()) .isNotNull(); ErlangTerm term = message.getBody(); assertThat(term.isTuple()).isTrue(); assertThat(term.size()).isEqualTo(2); assertThat(term.getUnsafe(0).asText()).isEqualTo("rex"); assertThat(term.getUnsafe(1).isTuple()).isTrue(); ErlangTerm response1 = term.getUnsafe(1); assertThat(response1.getUnsafe(0).isNumber()).isTrue(); assertThat(response1.getUnsafe(1).isNumber()).isTrue(); assertThat(response1.getUnsafe(2).isNumber()).isTrue(); mailbox.call(ELIXIR_ECHO_SERVER, "erlang", "date"); ErlangTerm response2 = mailbox.receiveRemoteProcedureResult(5, SECONDS); assertThat(response2).isEqualTo(response1); }
public ModuleMailbox.NewMailboxBuilder mailbox () { return moduleMailbox.mailbox(); }
Node implements Closeable { public ModuleMailbox.NewMailboxBuilder mailbox () { return moduleMailbox.mailbox(); } }
Node implements Closeable { public ModuleMailbox.NewMailboxBuilder mailbox () { return moduleMailbox.mailbox(); } @Builder private  Node(@NonNull NodeDescriptor descriptor,
                @NonNull Meta meta,
                @NonNull EpmdClient epmd,
                int creation,
                @NonNull NodeConfig config
  ); }
Node implements Closeable { public ModuleMailbox.NewMailboxBuilder mailbox () { return moduleMailbox.mailbox(); } @Builder private  Node(@NonNull NodeDescriptor descriptor,
                @NonNull Meta meta,
                @NonNull EpmdClient epmd,
                int creation,
                @NonNull NodeConfig config
  ); RemoteNode lookup(String name); RemoteNode lookup(ErlangPid pid); RemoteNode lookup(NodeDescriptor nodeDescriptor); boolean ping(String name); boolean ping(NodeDescriptor nodeDescriptor); boolean ping(RemoteNode remote); ErlangReference newReference(); ModuleMailbox.NewMailboxBuilder mailbox(); boolean register(Mailbox mailbox, String name); void deregister(String name); Mailbox mailbox(String name); Mailbox mailbox(ErlangPid pid); void remove(Mailbox mailbox); void remove(String name); void remove(ErlangPid pid); Map<ErlangPid, Mailbox> mailboxes(); CompletableFuture<Connection> connectAsync(RemoteNode remote); Connection connect(RemoteNode remote); Connection connect(RemoteNode remote, long timeout, TimeUnit unit); boolean isAvailable(RemoteNode remote); @Override void close(); }
Node implements Closeable { public ModuleMailbox.NewMailboxBuilder mailbox () { return moduleMailbox.mailbox(); } @Builder private  Node(@NonNull NodeDescriptor descriptor,
                @NonNull Meta meta,
                @NonNull EpmdClient epmd,
                int creation,
                @NonNull NodeConfig config
  ); RemoteNode lookup(String name); RemoteNode lookup(ErlangPid pid); RemoteNode lookup(NodeDescriptor nodeDescriptor); boolean ping(String name); boolean ping(NodeDescriptor nodeDescriptor); boolean ping(RemoteNode remote); ErlangReference newReference(); ModuleMailbox.NewMailboxBuilder mailbox(); boolean register(Mailbox mailbox, String name); void deregister(String name); Mailbox mailbox(String name); Mailbox mailbox(ErlangPid pid); void remove(Mailbox mailbox); void remove(String name); void remove(ErlangPid pid); Map<ErlangPid, Mailbox> mailboxes(); CompletableFuture<Connection> connectAsync(RemoteNode remote); Connection connect(RemoteNode remote); Connection connect(RemoteNode remote, long timeout, TimeUnit unit); boolean isAvailable(RemoteNode remote); @Override void close();  }