agentleFS
rainoftimerainoftime/pl-skills/actor-model-implementer/SKILL.md

actor-model-implementer

Skill17 starsChanged 9 months agoApache-2.0View on GitHub

Implements actor model for concurrent computation. Use when: (1) Building

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Request-response: - Ask with reply

    line 82
  2. Distinctive:

    Avoid blocking in actors

    line 90
  3. Distinctive:

    Use supervision for fault tolerance

    line 91
  4. Distinctive:

    Consider actor per request for isolation

    line 92

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Actor Model Implementer

Implements the actor model for concurrent computation.

When to Use

  • Building concurrent/distributed systems
  • Implementing fault-tolerant systems
  • Modeling reactive systems
  • Erlang/Elixir-style concurrency

What This Skill Does

  1. Creates actors - Independent computational entities
  2. Handles message passing - Asynchronous communication
  3. Manages mailboxes - Message queuing
  4. Implements behaviors - Actor state machines

Usage Example

# Create system
system = ActorSystem("example")

# Spawn counter
counter_ref = system.spawn(CounterActor)

# Send messages
counter_ref.tell(10)           # Add 10
counter_ref.tell("get")        # Query count

# Ask pattern
def on_reply(count):
    print(f"Count is: {count}")

# Get reply
future = counter_ref.ask("get")
print(f"Count: {future.result()}")

# Spawn ping-pong
ping = system.spawn(PingPongActor)
pong = system.spawn(PingPongActor)

ping.tell("ping", sender=pong)

# Shutdown
system.stop()

Key Concepts

ConceptDescription
ActorIsolated computation with private state
MailboxMessage queue
AddressReference to actor (PID)
Message passingAsync, no sharing
BehaviorMessage handler function
SupervisionFault handling hierarchy

Actor Patterns

  • Fire and forget - Async send
  • Request-response - Ask with reply
  • Pipeline - Chain actors
  • Pub/sub - Topic-based messaging
  • Aggregator - Collect results

Tips

  • Keep messages immutable
  • Avoid blocking in actors
  • Use supervision for fault tolerance
  • Consider actor per request for isolation
  • Monitor mailbox sizes

Related Skills

  • software-transactional-memory - STM concurrency
  • race-detection-tool - Detect race conditions
  • cps-transformer - First-class continuations

Research Tools & Artifacts

Actor model implementations:

SystemLanguageWhat to Learn
Erlang/OTPErlangOriginal actor model
AkkaScala/JavaProduction actors
Erlang/ElixirElixirDistributed actors
Scala AkkaScalaTyped actors
PonyPonyCapabilities-based actors

Papers

  • Hewitt, Bishop, Steiger (1973) - Original actor model paper "A Universal Modular ACTOR Formalism for Artificial Intelligence"
  • Agha (1986) - "Actors: A Model of Concurrent Computation in Distributed Systems"
  • Armstrong - Erlang design papers

Research Frontiers

1. Type-Safe Actors

  • Challenge: Message type safety
  • Approach: Typed channels, session types
  • Tools: Akka Typed, Pony

2. Distributed Actor Frameworks

  • Challenge: Location transparency
  • Approach: Remoting, cluster management

Implementation Pitfalls

PitfallReal ConsequenceSolution
BlockingMailbox buildupAsync operations
Shared mutable stateRace conditionsImmutable messages
DeadlocksSystem haltAvoid cyclic dependencies

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.