Flowdock
method

periodically

Importance_1
Ruby on Rails latest stable (v5.2.3) - 0 notes - Class: ClassMethods
periodically(callback_or_method_name = nil, every:, &block) public

Periodically performs a task on the channel, like updating an online user counter, polling a backend for new status messages, sending regular “heartbeat” messages, or doing some internal work and giving progress updates.

Pass a method name or lambda argument or provide a block to call. Specify the calling period in seconds using the every: keyword argument.

periodically :transmit_progress, every: 5.seconds

periodically every: 3.minutes do
  transmit action: :update_count, count: current_count
end
Show source
Register or log in to add new notes.