MCPcopy Index your code
hub / github.com/RuedigerMoeller/kontraktor

github.com/RuedigerMoeller/kontraktor @4.19

Chat with this repo
repository ↗ · DeepWiki ↗ · release 4.19 ↗ · + Follow
6,221 symbols 18,986 edges 505 files 1,262 documented · 20%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

kontraktor 4

What is kontraktor ?

  • A boilerplate free and consistent abstraction for asynchronous remote communication powered by a distributed actor-model
  • A SPA WebApp platform supporting a Java backend for modern SPA javascript client frameworks like Polymer.js, vue.js and React.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
  • eases polyglot (java, javascript nodejs + browser) (micro-)service oriented distributed systems
  • separates network transport (TCP, WebSockets, Http) and message encoding (fast-serialization, json, ..) from application code.
  • Async REST services
  • asynchronous, non-blocking
  • high performance
  • production proven

Documentation

Code Examples, Related Blogpost's

What can I use it for ?

  • build modern microservice systems (java (JVM), nodejs) beyond the Limits of REST. Asynchronous, event sourced, encoding (fast binary, json for interop) and network transport independent (choose from TCP, WebSockets, Http-(Long Poll)).
  • 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).

Core Documentation [in progress]

<dependency>
    <groupId>de.ruedigermoeller</groupId>
    <artifactId>kontraktor</artifactId>
    <version>4.19</version>
</dependency>

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

JavaScript, Http-Documentation [in progress]

Instrinsic React/JSX Documentation [in progress]

<dependency>
    <groupId>de.ruedigermoeller</groupId>
    <artifactId>kontraktor-http</artifactId>
    <version>4.19</version>
</dependency>

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

Extension points exported contracts — how you extend this code

TranspilerHook (Interface)
Created by ruedi on 21.05.16. hook to transpile files dynamically. Hooks can be registered in the http4k builder class [7 …
modules/kontraktor-http/src/main/java/org/nustaq/kontraktor/webapp/transpiler/TranspilerHook.java
ChangeReceiver (Interface)
Created by moelrue on 03.08.2015. [11 implementers]
modules/kontraktor-reallive/src/main/java/org/nustaq/reallive/api/ChangeReceiver.java
ActorPublisher (Interface)
Configuration object to publish an actor to network. Serverside aequivalent to ConnectableActor [7 implementers]
src/main/java/org/nustaq/kontraktor/remoting/base/ActorPublisher.java
RequestProcessor (Interface)
Created by ruedi on 13.08.2014. processes http (rest) requests, can be asynchronous (e.g. implemented by an actor) [4 …
attic/RequestProcessor.java
ConnectionListener (Interface)
Created by ruedi on 06/06/15. [2 implementers]
modules/kontraktor-bare/src/main/java/org/nustaq/kontraktor/barebone/ConnectionListener.java
ISessionStorage (Interface)
Created by ruedi on 20.06.17. Defines Persistance requirements. There is a default implementation based on memory mappe [2 …
modules/kontraktor-web/src/main/java/org/nustaq/kontraktor/weblication/ISessionStorage.java
IDataConnected (Interface)
Created by ruedi on 29.05.17. [1 implementers]
modules/service-suppport/src/main/java/org/nustaq/kontraktor/services/rlclient/IDataConnected.java
DataAccess (Interface)
(no doc) [3 implementers]
src/test/java/kontraktor/BasicTest.java

Core symbols most depended-on inside this repo

println
called by 560
modules/kontraktor-http/src/main/java/org/nustaq/kontraktor/webapp/transpiler/jsx/GenOut.java
warning
called by 351
examples/webapp-spa/misc/react-no-babel/src/main/web/lib/history.js
apply
called by 300
modules/kontraktor-reallive/src/main/java/org/nustaq/reallive/impl/actors/ShardFunc.java
then
called by 268
src/main/java/org/nustaq/kontraktor/IPromise.java
get
called by 250
modules/kontraktor-reallive/src/main/java/org/nustaq/reallive/query/EvalContext.java
push
called by 237
examples/webapp-spa/misc/servlet/embedded-tomcat-servlet/src/main/java/org/nustaq/http/example/ServletSession.java
forEach
called by 210
modules/kontraktor-reallive/src/main/java/org/nustaq/reallive/api/RealLiveStreamActor.java
get
called by 205
src/main/java/org/nustaq/kontraktor/IPromise.java

Shape

Method 3,767
Function 1,701
Class 694
Interface 52
Enum 7

Languages

Java60%
TypeScript40%
Kotlin1%

Modules by API surface

examples/webapp-spa/misc/servlet/react-intrinsic-minimal-servlet/src/main/webapp/lib/react-dom.js355 symbols
examples/webapp-spa/misc/react-no-babel/src/main/web/lib/react-dom.js355 symbols
examples/webapp-spa/misc/react-intrinsic-minimal/src/main/web/lib/react-dom.js355 symbols
examples/webapp-spa/misc/react-no-babel/src/main/web/lib/react-router-dom.js152 symbols
examples/webapp-spa/misc/react-no-babel/src/main/web/lib/react-router.js98 symbols
examples/webapp-spa/misc/servlet/react-intrinsic-minimal-servlet/src/main/webapp/lib/react.js97 symbols
examples/webapp-spa/misc/react-no-babel/src/main/web/lib/react.js97 symbols
examples/webapp-spa/misc/react-intrinsic-minimal/src/main/web/lib/react.js97 symbols
src/test/java/kontraktor/BasicTest.java80 symbols
src/main/java/org/nustaq/kontraktor/Actor.java62 symbols
modules/kontraktor-http/src/main/javascript/kontraktor-client/kontraktor-client.js57 symbols
examples/webapp-spa/misc/servlet/react-intrinsic-minimal-servlet/src/main/webapp/lib/kontraktor-client.js57 symbols

For agents

$ claude mcp add kontraktor \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page