Im need to retrieve data for account in parallel. I use celluloid for that
my code
class Daemon
def self.start
loop do
Account.all.each do |acc|
unless Celluloid::Actor[account.name]
supervise_as(account.name, account)
Celluloid::Actor[account.name].async(:perform)
end
sleep 10.minutes
end
end
def initialize(account)
@account = account
end
def perform
loop do
do_request
sleep 10
end
end
end
On start it always do parallel request for all members(bob, alice, etc). But after some time it makes requests only for one user (alice for ex.)
PS in do_request
used self-made redis queue
and in Celluloid::Actor.registed
all accounts exists