Class: RactorRailsShim::NoOpLock

Inherits:
Object
  • Object
show all
Defined in:
lib/ractor_rails_shim/patches/callables.rb

Instance Method Summary collapse

Instance Method Details

#lockObject



167
# File 'lib/ractor_rails_shim/patches/callables.rb', line 167

def lock; self; end

#locked?Boolean

Returns:

  • (Boolean)


169
# File 'lib/ractor_rails_shim/patches/callables.rb', line 169

def locked?; false; end

#mon_enterObject



170
# File 'lib/ractor_rails_shim/patches/callables.rb', line 170

def mon_enter; end

#mon_exitObject



171
# File 'lib/ractor_rails_shim/patches/callables.rb', line 171

def mon_exit; end

#mon_locked?Boolean

Returns:

  • (Boolean)


172
# File 'lib/ractor_rails_shim/patches/callables.rb', line 172

def mon_locked?; false; end

#mon_synchronizeObject



166
# File 'lib/ractor_rails_shim/patches/callables.rb', line 166

def mon_synchronize; yield; end

#new_condObject

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

#synchronizeObject



165
# File 'lib/ractor_rails_shim/patches/callables.rb', line 165

def synchronize; yield; end

#try_lockObject



173
# File 'lib/ractor_rails_shim/patches/callables.rb', line 173

def try_lock; true; end

#unlockObject



168
# File 'lib/ractor_rails_shim/patches/callables.rb', line 168

def unlock; self; end