Skip to main content

Design Patterns in MonoTerm

This document explains the key design patterns used in MonoTerm’s architecture. These patterns are language-independent design solutions, not Rust-specific features.

The Problem: Concurrent Access

Multiple parts of the system need to access session data simultaneously.

Solution 1: Mutex (Traditional)

The traditional approach uses locks.

Solution 2: Actor Pattern (MonoTerm)

MonoTerm uses the Actor pattern - no locks needed.

SessionActor Structure

The SessionActor owns all session state.

Actor Pattern Benefits


Why Rust?

The patterns work in any language, but Rust provides additional benefits.

Complete Architecture


Summary