ruby / tmpdir

Retrieve temporary directory path
5 stars 11 forks source link

Improve Ractor-compliance #9

Open rm155 opened 3 years ago

rm155 commented 3 years ago

In order to be Ractor-compliant, tmpdir must avoid relying on class variables. In non-main Ractors, where @@systmpdir cannot be accessed, a default value can be used instead.

Additionally, instance of the class Random cannot be made shareable, so RANDOM can be an instance of Object instead. This means that the “next” method would use Kernel#rand instead of Random#rand, but the method should still work.