Module: Motion::ActionCableExtentions::Synchronization
- Included in:
- DeclarativeNotifications, DeclarativeStreams
- Defined in:
- lib/motion/action_cable_extentions/synchronization.rb
Instance Method Summary collapse
- #initialize ⇒ Object
- #perform_action ⇒ Object
-
#subscribe_to_channel ⇒ Object
Synchronize all standard ActionCable entry points.
-
#synchronize_entrypoint!(&block) ⇒ Object
Additional entrypoints added by other modules should wrap any entry points that they add with this.
- #unsubscribe_from_channel ⇒ Object
Instance Method Details
#initialize ⇒ Object
8 9 10 11 12 |
# File 'lib/motion/action_cable_extentions/synchronization.rb', line 8 def initialize(*) super @_monitor = Monitor.new end |
#perform_action ⇒ Object
29 30 31 |
# File 'lib/motion/action_cable_extentions/synchronization.rb', line 29 def perform_action(*) synchronize_entrypoint! { super } end |
#subscribe_to_channel ⇒ Object
Synchronize all standard ActionCable entry points.
21 22 23 |
# File 'lib/motion/action_cable_extentions/synchronization.rb', line 21 def subscribe_to_channel(*) synchronize_entrypoint! { super } end |
#synchronize_entrypoint!(&block) ⇒ Object
Additional entrypoints added by other modules should wrap any entry points that they add with this.
16 17 18 |
# File 'lib/motion/action_cable_extentions/synchronization.rb', line 16 def synchronize_entrypoint!(&block) @_monitor.synchronize(&block) end |
#unsubscribe_from_channel ⇒ Object
25 26 27 |
# File 'lib/motion/action_cable_extentions/synchronization.rb', line 25 def unsubscribe_from_channel(*) synchronize_entrypoint! { super } end |