Closed ioquatix closed 10 years ago
Can you make this issue on the Celluloid repo instead of Celluloid::IO? Showing the exception would help too ;)
tl;dr: yes it's expected behavior. Blocks run in the context of the caller, not the receiver, as this prevents thread synchronization issues with the state that blocks close over, so instance_eval can't work in this setup (unless explicitly whitelisted, which is possible, and maybe should be the default)
So, I assume the best way to fix this is to construct all the state in the receiver then set that in one go in the initialise method. I'll try it and report back.
The following example fails. Is this expected behaviour?