@Test public void testRejectIfNotOpen() { MailboxProcessor mailboxProcessor = new MailboxProcessor((ctx) -> {}); try { mailboxProcessor.getMailboxExecutor().execute(() -> {}); Assert.fail("Should not be able to accept runnables if not opened."); } catch (RejectedExecutionException expected) { } }
public MailboxExecutorService getMailboxExecutor() { return mailboxExecutor; }
MailboxProcessor { public MailboxExecutorService getMailboxExecutor() { return mailboxExecutor; } }
MailboxProcessor { public MailboxExecutorService getMailboxExecutor() { return mailboxExecutor; } MailboxProcessor(MailboxDefaultAction mailboxDefaultAction); }
MailboxProcessor { public MailboxExecutorService getMailboxExecutor() { return mailboxExecutor; } MailboxProcessor(MailboxDefaultAction mailboxDefaultAction); MailboxExecutorService getMailboxExecutor(); void open(); void prepareClose(); void close(); void runMailboxLoop(); void reportThrowable(Throwable throwable); void allActionsCompleted(); }
MailboxProcessor { public MailboxExecutorService getMailboxExecutor() { return mailboxExecutor; } MailboxProcessor(MailboxDefaultAction mailboxDefaultAction); MailboxExecutorService getMailboxExecutor(); void open(); void prepareClose(); void close(); void runMailboxLoop(); void reportThrowable(Throwable throwable); void allActionsCompleted();  }