Creating a UDP server with Ruby Ractors

17-Mar-2021 229
Ruby (MRI) has a Global VM lock. This means that you cannot execute code in multiple threads at the same time. You can achieve a lot of great things with Threads, especially if you have a lot of I/O, but parallel execution in Threads does not exist in Ruby.Ruby 3.0 introduces Ractors, a concept that lets you create true parallel execution with messages flowing between Ractors instead of shared objects. You can think of a Ractor as an independent worker that you can call up and ask to do a task for you while you do something else.This feature is experimental in Ruby 3.0 and might have changes in the future. All examples here are with Ruby 3.0.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle