July 12, 2016 A gentle introduction to nio4r: low-level portable asynchronous I/O for Ruby Rails 5.0 was recently released, and with it came ActionCable, a new part of the framework to put WebSockets “on Rails”. ActionCable has had something of a sordid history, from taking Rails Core developer Aaron Patterson by surprise when he first heard of it at a RailsConf keynote to at one point using both
Painless multithreaded programming for RubyCelluloid is a concurrent object oriented programming framework for Ruby which lets you build multithreaded programs out of concurrent objects just as easily as you build sequential programs out of regular objects. Learn more Evented I/O for Celluloid actors. Build fast evented programs like you would with EventMachine or Node.js using regular synchronous
require 'celluloid' class Counter include Celluloid attr_reader :count def initialize @count = 0 end def increment(n = 1) sleep n @count += n end end actor = Counter.new p actor.count #=> 0 p actor.increment #=> 1 p actor.async.increment(41) #=> nil p actor.count #=> 1 Celluloidの機能を使うには、ActorにしたいクラスにCellloidをincludeします。 #asyncをはそれに続くメソッド呼び出しが非同期になるようなプロキシを返します。メソッド呼び出しはnilを返すため、本来返ってくるはずの返り値は使えません
2015-10-14 I’ve used Celluloid from day one. More importantly I’ve evanglized Celluloid and advised Rubyists to use it. So it came as a shock to several people that I recently overhauled Sidekiq to remove Celluloid. What does that mean? I must be a huge hypocrite! Engineering is about trade offs. To make something easier or safer to use, create an abstraction layer. To make something faster, remov
celluloidを使う機会が出たので、ついでにCelluloid::Loggerを使ってみたところ、Celluloid.logger.errorがthorのerrorに優先されてしまい期待通りの動きをしてくれなかった。 期待通り動かない場合 以下を実行するとsample.logにerrorが出力されずにstdoutに出力される require 'thor' require 'celluloid' include Celluloid::Logger Celluloid.logger = ::Logger.new("sample.log") class SampleThor < Thor desc "test", "sample" def test error "test" end end SampleThor.start(ARGV) Celluloid.loggerのerrorでなくTho
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く