DEV Community

chenge
chenge

Posted on

1 3

Implements Erlang Process using Ruby -- spawn, receive, scheduler

This is written by others, I think it's fun so post it here.


require "./erl_scheduler"
require "./erl_process"

scheduler = ErlScheduler.new
counter = scheduler.spawn(Counter)

10000.times do |i|
  scheduler.send_message(counter, :inc)
end

scheduler.send_message(counter, :stop)
scheduler.loop

translated link -->

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay