kontraktor_Kontraktor: Kontraktor 是一个 Java 编写的轻量级高效 Actor 模型实现

kontraktor 4

What is kontraktor ?

A boilerplate free and consistent abstraction for asynchronous remote communication powered by a distributed actor-model

One important application of this abstraction are SPA WebApplications enabling Java to back modern SPA javascript client frameworks like React.js, Polymer.js, .. (transpilation, packaging, optimization). Different to webpack/browserify etc. kontraktor does this on the fly (when running in prod mode) without an extra build step using pure java. see IntrinsicReact example

separates network transport (TCP, WebSockets, Http) and message encoding (fast-serialization, json, ..) from application code.

asynchronous, non-blocking,high performance

production proven

What can I use it for ?

build modern microservice systems (java (JVM), nodejs) beyond the Limits of REST. Asynchronous, event sourced, independent of encoding and network transport (choose from TCP, WebSockets, Http-(Long Poll), json or binary encoding).

power modern SPA apps with a java based webserver

Credits: kontraktor makes use of many awesome open source libraries such as

undertow, (io.undertow) see undertow.io

jsoup (org.jsoup) - real world html parser

httpasyncclient (org.apache.httpcomponents)

npm-semver, (com.github.yuchi)

fast-classpath-scanner (io.github.lukehutch)

org.apache.commons, slf4j-api, minimal-json (com.eclipsesource.minimal-json), junit

Modules

Kontraktor consists of several modules. For sake of simplicity all module versions are kept in sync with kontraktor core.

Kontraktor Core

Actors + TCP Remoting

transform regular java code (satisfying some conventions) into remoteable actors.

no boilerplate required

TCP remoting included (2 implementations: SyncIO and AsyncIO)

general messaging optimizations: batching, binary queues (reduce GC load + save heap by queuing raw bytes instead of object's).

de.ruedigermoeller

kontraktor

4.22

Kontraktor Http

Adds WebSockets, Http LongPoll for actor-remoting, JavaScript interop. Uses Undertow as underlying webserver

npm modules to (a) implement a kontraktor actor (=service) using nodejs and (b) to connect a kontraktor service from nodejs

server push via adaptive longpolling (polling automatically turns off if no pending callback / promise is present)

support for websockets

advanced bundling and inlining of resources (js, css, html) webpack style. Instead of introducing a build step, kontraktor bundles and caches your stuff dynamically upon first request (production mode).

session handling fundamentals

de.ruedigermoeller

kontraktor-http

4.22.3

kontraktor-http 4 javascript nodejs. npm modules

kontraktor-common

defines fundamentals: remote actor refs, en/decoding of Java-serialized objects, KPromise

kontraktor-client

Can be used from a browser (attention then: needs to be added using a

Can be used from nodejs to connect services/actors implemented in java or javascript

kontraktor-server

write an ES6 class and make it accessible to other (kontraktor) processes using websockets. Some limitations: no actor proxies, only websockets supported.

js4k

old (es5) implementation of kontraktor-client. somewhat messy, but production-proven

Kontraktor-Bare

(Minimalistic standalone Http-LongPoll client [legacy apps, Android] ), requires Java 7, Apache 2.0 Licensed

de.ruedigermoeller

kontraktor-bare

4.22

Examples:

Misc

Older Blogposts (samples are of OLD 2.0, 3.0 version, might need rewrite/changes (mostly Future => IPromise):

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值