JActor 2.2.0 RC3 发布,该版本的 JLPCActor 更加轻量级以及提升了工厂类组件,actor 创建现在已经可达到每秒 1 亿(真的假的?)
JActor 是一个 Java 的 Actor 模式的实现。
示例代码:
- 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();
- }
下载地址:https://github.com/laforge49/JActor
【编辑推荐】