@Test public void sendFromOneToAnotherNode () throws Exception { val name1 = createName(); val name2 = createName(); node = Nodes.singleNode(name1, true); Mailbox mailbox1 = node.mailbox() .name("popa1") .build(); try (val node2 = Nodes.singleNode(name2, true)) { String text1 = "Hello world 1"; String text2 = "Hello world 2"; Mailbox mailbox2 = node2.mailbox() .name("popa2") .build(); mailbox2.send(name1, "popa1", string(text1)); assertThat(mailbox1.receive().getBody().asText()) .isEqualTo(text1); mailbox1.send(name2, "popa2", string(text2)); assertThat(mailbox2.receive().getBody().asText()) .isEqualTo(text2); } }
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();  }