JActor 4.2.0 RC1 发布,增加对降级 actors (无 mailbox 的 actors) 的支持,用于单线程和线程安全的应用程序。

JActor 是一个 Java 的 Actor 模式的实现,经过测试在 i5 CPU 上可支持每秒钟发送超过亿条消息,可能是目前最快的。这相当于是 Scala 的 Actor 的纯 Java 版本。

示例代码:

JAMailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1); try {     Mailbox mailbox = mailboxFactory.createMailbox();     JCActor a = new JCActor(mailbox);     (new Include(Greeter.class)).call(a);     JAFuture future = new JAFuture();     String greeting = (new Hi()).send(future, a);     System.out.println(greeting); } catch (Exception e) {     e.printStackTrace(); } finally {     mailboxFactory.close(); }

相关文章:

  • 2021-09-20
  • 2021-11-01
  • 2022-01-16
  • 2022-02-13
  • 2022-02-15
  • 2022-01-18
  • 2021-09-01
猜你喜欢
  • 2022-02-13
  • 2021-06-03
  • 2022-12-23
  • 2021-10-23
  • 2022-12-23
  • 2021-10-11
  • 2021-08-06
相关资源
相似解决方案