Skip to content

Instantly share code, notes, and snippets.

@francescoagati
Created September 28, 2012 15:29
Show Gist options
  • Save francescoagati/3800530 to your computer and use it in GitHub Desktop.
Save francescoagati/3800530 to your computer and use it in GitHub Desktop.
rendering cell inside celluloid actor
class ActorCell
include Celluloid
def render_cell(class_cell,state,args={})
class_cell.new.render_state(state,args)
end
end
ActorCellPoll=ActorCell.pool(size:30)
cells=[
ActorCellPoll.future(:render_cell, MusicCell, :playlist, :tags => [:rock])
ActorCellPoll.future(:render_cell, MusicCell, :playlist, :tags => [:classic])
ActorCellPoll.future(:render_cell, MusicCell, :playlist, :tags => [:tango])
]
cells.map {|future| future.value }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment