Skip to main content
Cajun Logo

Cajun

Concurrency And Java UNlocked - A lightweight actor framework for Java

🚀 Near-Zero Overhead

0.02% overhead for I/O workloads. Built on Java 21+ virtual threads for exceptional performance in microservices and web applications.

🔒 Lock-Free Programming

Write concurrent code without locks, race conditions, or deadlocks. Actors process messages sequentially with isolated state.

⚡ Production Ready

Built-in persistence, clustering, backpressure, and supervision. Comprehensive benchmarks and 100+ passing tests.

🎯 Functional Programming

Effect monad for composable behaviors with stack-safety. Natural blocking I/O on virtual threads.

🌐 Distributed Systems

Multi-node clustering with automatic failover. Pluggable metadata stores and message delivery guarantees.

📊 Flexible Configuration

Configurable mailboxes, thread pools, and backpressure strategies. Simple defaults that work for 99% of use cases.

Quick Example

// Simple stateless actor
public class GreeterHandler implements Handler<String> {
@Override
public void receive(String message, ActorContext context) {
System.out.println("Hello, " + message + "!");
}
}

// Create actor system and spawn actor
ActorSystem system = new ActorSystem();
Pid greeter = system.actorOf(GreeterHandler.class)
.spawn();

// Send message
greeter.tell("World");

// Clean shutdown
system.shutdown();