This document introduces Jobim, an actor library for Clojure that enables building distributed, concurrent applications. It describes actors as named channels that receive and send messages. Jobim provides protocols for messaging, coordination, and serialization that can be extended with plugins. It also includes behaviors like supervisor, server, and finite state machine patterns to help reuse distributed logic. The library aims to integrate well with Clojure while providing solutions for distribution challenges like coordination and serialization.
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
4th European Lisp Symposium: Jobim: an Actors Library for the Clojure Programming Language
1. Jobim: an Actors
Library for the Clojure
Programming Language
Antonio Garrote
María N. Moreno García
2. Clojure
• New Lisp dialect
• Hosted: JVM, CLR
• Focus on concurrency: (STM, Agents,
futures, fork-join, java.util.concurrent.*)
3. Distributed concurrent
applications in Clojure?
“Given the diversity, sophistication, maturity,
interoperability,robustness etc of these options, it's
unlikely I'm going to fiddle around with some
language-specific solution.”
Rich Hickey
15. Message Box
• Lamina - Z. Tellman (https://github.com/
ztellman/lamina)
• Transforms Clojure sequences into event-
driven channels
• Synchronous and asynchronous interface
16. PIDs/Channel Names
• Plain Java strings: easy to exchange
• Globally unique identifiers for actors across
all the nodes in a Jobim cluster
• Generated by Jobim’s runtime
• GUID node + process counter
17. Execution context
• Threaded actors:
- Java thread per actor
- End of thread execution, releases
resources
- Threaded actors do not scale (~2000
threads per node max.)
18. Execution context
• Evented actors (Scala):
- Actors context = closure + callback
functions
- Small number of reactor threads execute
all the evented threads
31. Reusing distributed
components?
• Encapsulate distributed patterns
• Hide message passing logic
• Building blocks for larger distributed
systems
• Built using Clojure protocols
• Threaded and evented versions