You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
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を返すため、本来返ってくるはずの返り値は使えません
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く