codegram / futuroscope

Yet another Futures implementation in Ruby
MIT License
210 stars 13 forks source link

Allow marshalling of Future instances #11

Closed dbussink closed 10 years ago

dbussink commented 10 years ago

Before this would fail with an error that Mutex can't be marshalled. This commit changes the logic so that marshalling will wait until the future is finished and then marshals the object.

It also needs to define __setobj__ so it the object can be properly unmarshalled.

This was discovered because an object containing a future was used in Rails caching which uses Marshal.

coveralls commented 10 years ago

Coverage Status

Coverage increased (+0.8%) when pulling d591f92cad6b0741cc347fe69e1a2a50a939ee6a on dbussink:marshal_futures into acb9f95bfc0c823b4018a51a25b7e78f5cf5b6c9 on codegram:master.

txus commented 10 years ago

Nice one! Thank you! :)