celluloid / dcell

UNMAINTAINED: See celluloid/celluloid#779 - Actor-based distributed objects in Ruby based on Celluloid and 0MQ
http://celluloid.io
MIT License
595 stars 65 forks source link

JDBC via Sequel over DCell #25

Closed zefijsd closed 12 years ago

zefijsd commented 12 years ago

I'd like to do the same thing as mentioned here http://ewout.name/2010/10/jdbc-access-with-distributed-ruby/ But with DCell instead of Drb, and I miserably fail.

I tried to make something like :

class SequelCsvSource
  include Celluloid
  def initialize
    @db = Sequel.connect("jdbc:h2:mem:")
  end

  def load(file)
    @ds = @db.fetch("SELECT * FROM CSVREAD('#{file}')")
  end
end

But it seems I cannot expose a sequel dataset as it contains Procs and they can't be serialized. JRuby gives me this error :

 Celluloid::AbortError: caused by TypeError: no marshal_dump is defined for class Proc

Any ideas ?

zefijsd commented 12 years ago

"Blocks are presently not supported by DCell, the distributed version of Celluloid. This is because DCell depends on Ruby Marshal as its wire protocol, and Ruby presently has no standard format for marshaling Procs, which would be the only way DCell could send blocks over the wire. Future versions will hopefully be able to support blocks by running them in the caller's context (i.e. it will need to round trip via Marshal/0MQ over the wire each time a block is called)"

Sorry for the noise :)