You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require'chunky_png'ractor=Ractor.new{ChunkyPNG::Canvas.from_file("some_image.png")}img=ractor.take# do something with img...
results in a Ractor::IsolationError saying that some constant is non-shareable. To work around this, I had to manually freeze any constants that were accessed by the call. These were the ones I had to freeze for this specific example (i.e. putting this code at the top allows the example to run):
I haven't messed around with any of the other functions yet, so I'm sure there are other non-frozen constants in the library that may need to be frozen to allow some methods to work with Ractors.
The text was updated successfully, but these errors were encountered:
I just learned about the shareable_constant_value pragma, which would pretty much perform the same thing as my pull request. Use that instead, if you prefer.
Trying to run the following code:
results in a
Ractor::IsolationError
saying that some constant is non-shareable. To work around this, I had to manually freeze any constants that were accessed by the call. These were the ones I had to freeze for this specific example (i.e. putting this code at the top allows the example to run):I haven't messed around with any of the other functions yet, so I'm sure there are other non-frozen constants in the library that may need to be frozen to allow some methods to work with Ractors.
The text was updated successfully, but these errors were encountered: