原文
| ||||||||||||||
| ||||||||||||||
![]() |
原始链接: https://news.ycombinator.com/item?id=43451285
Hacker News 上的一篇文章重点介绍了 Mike Perham(Sidekiq 的创建者)使用 Ruby 的 Ractors 来扩展使用 Redis 集群的 Sidekiq 的实验。Ractors 的目的是允许 Ruby 代码绕过全局虚拟机锁 (GVL),从而实现并发。Perham 使用了他的“Ratomic”库,该库为 Ractors 提供了可变的数据结构。然而,他发现 Ractors 难以编程,并指出了诸如缺乏词法作用域和闭包变量访问之类的限制。他将这种体验比作最初学习 Go 语言中的 goroutines 和 channels,这表明有效采用 Ractors 需要克服相当大的学习曲线。尽管面临挑战,但他的努力表明了利用 Ractors 来扩展 Ruby 应用程序(尤其是在 Sidekiq 的上下文中)的趋势。
| ||||||||||||||
| ||||||||||||||
![]() |
I then see that he posted: https://ruby.social/@getajobmike/114147139715606013
""" After months of work on 8.0, I’ve been trying to prototype a Ractor-based job system using Redis Cluster so the system can scale to hundreds of Redises with minimal effort.
The hardest part is Ractors. They are quite difficult to program as they don’t allow lexical scope or closure variable access. I haven’t yet figured out the code patterns necessary for them. I would call it a dialect of Ruby.
To be fair, I think I had the same struggles when learning goroutines and channels. """
Looks like he's trying to scale up sidekiq!
reply