module Motion::ActionCableExtentions::Synchronization

Public Class Methods

new(*) click to toggle source
Calls superclass method
# File lib/motion/action_cable_extentions/synchronization.rb, line 8
def initialize(*)
  super

  @_monitor = Monitor.new
end

Public Instance Methods

perform_action(*) click to toggle source
Calls superclass method
# File lib/motion/action_cable_extentions/synchronization.rb, line 29
def perform_action(*)
  synchronize_entrypoint! { super }
end
subscribe_to_channel(*) click to toggle source

Synchronize all standard ActionCable entry points.

Calls superclass method
# File lib/motion/action_cable_extentions/synchronization.rb, line 21
def subscribe_to_channel(*)
  synchronize_entrypoint! { super }
end
synchronize_entrypoint!(&block) click to toggle source

Additional entrypoints added by other modules should wrap any entry points that they add with this.

# File lib/motion/action_cable_extentions/synchronization.rb, line 16
def synchronize_entrypoint!(&block)
  @_monitor.synchronize(&block)
end
unsubscribe_from_channel(*) click to toggle source
Calls superclass method
# File lib/motion/action_cable_extentions/synchronization.rb, line 25
def unsubscribe_from_channel(*)
  synchronize_entrypoint! { super }
end