Actions
Feature #17418
closedAdd `Ractor.main?` and `Ractor.main`
Description
Since main Ractor is special, it seems useful to have an easy way to check if the current ractor is the main ractor.
Ractor.main? # => true
Ractor.new { Ractor.main? }.take # => false
As far as I know, a gem could be loaded from a non-main Ractor so there is no reliable way for a gem to know the main Ractor (except than trying to do something that is not allowed)
We might as well add Ractor.main
to return the main Ractor (probably less useful though).
Actions
Like0
Like0Like0Like0