Class: RactorRailsShim::NoOpLock
- Inherits:
-
Object
- Object
- RactorRailsShim::NoOpLock
- Defined in:
- lib/ractor_rails_shim/patches/callables.rb
Instance Method Summary collapse
- #lock ⇒ Object
- #locked? ⇒ Boolean
- #mon_enter ⇒ Object
- #mon_exit ⇒ Object
- #mon_locked? ⇒ Boolean
- #mon_synchronize ⇒ Object
-
#new_cond ⇒ Object
Returns a NoOpCond — a shareable, no-op stand-in for the MonitorMixin::ConditionVariable-like object that
lock.new_condyields in Rails' own Concurrent::Map / Monitor usage. - #synchronize ⇒ Object
- #try_lock ⇒ Object
- #unlock ⇒ Object
Instance Method Details
#lock ⇒ Object
167 |
# File 'lib/ractor_rails_shim/patches/callables.rb', line 167 def lock; self; end |
#locked? ⇒ Boolean
169 |
# File 'lib/ractor_rails_shim/patches/callables.rb', line 169 def locked?; false; end |
#mon_enter ⇒ Object
170 |
# File 'lib/ractor_rails_shim/patches/callables.rb', line 170 def mon_enter; end |
#mon_exit ⇒ Object
171 |
# File 'lib/ractor_rails_shim/patches/callables.rb', line 171 def mon_exit; end |
#mon_locked? ⇒ Boolean
172 |
# File 'lib/ractor_rails_shim/patches/callables.rb', line 172 def mon_locked?; false; end |
#mon_synchronize ⇒ Object
166 |
# File 'lib/ractor_rails_shim/patches/callables.rb', line 166 def mon_synchronize; yield; end |
#new_cond ⇒ Object
Returns a NoOpCond — a shareable, no-op stand-in for the
MonitorMixin::ConditionVariable-like object that lock.new_cond
yields in Rails' own Concurrent::Map / Monitor usage. Each method
is a true no-op so callers that cond.wait / cond.signal /
cond.broadcast from a worker Ractor don't block or touch
unshareable state. Replaces the anonymous
Struct.new(:wait, :signal, :broadcast).new(-> {}, -> {}, -> {})
— same duck-typing shape, but a named class so the condvar
contract is visible to readers (Issue #11).
183 |
# File 'lib/ractor_rails_shim/patches/callables.rb', line 183 def new_cond; NoOpCond.new; end |
#synchronize ⇒ Object
165 |
# File 'lib/ractor_rails_shim/patches/callables.rb', line 165 def synchronize; yield; end |
#try_lock ⇒ Object
173 |
# File 'lib/ractor_rails_shim/patches/callables.rb', line 173 def try_lock; true; end |
#unlock ⇒ Object
168 |
# File 'lib/ractor_rails_shim/patches/callables.rb', line 168 def unlock; self; end |