Search code examples
ruby-on-railsrubysidekiq

Is it possible that Ruby Marshallng may work differently with different versions of ruby?


I need to send complex object(https://github.com/nepalez/ebay_api - EbayAPI object may have big amount of data) to sidekiq. So, marshaling looks like a good solution. What I am afraid of: Is it possible that Ruby Marshaling may work differently with different versions of ruby?

So, one day I will update ruby version, and due load marshaled object the original object would be not the same, as before marshaled, is it possible?


Solution

  • "Note, however, that the binary format used by Marshal.dump and Marshal.load is version dependent, and newer versions of Ruby are not guaranteed to be able to read marshalled objects written by older versions of Ruby." (The Ruby Programming Language, David Flanagan and Yukuhiro Matsumoto, page 83).