You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: progress_ticker.rb
    path of file: ./repos/archivesspace/backend/app/lib
    
    the code of the file until where you have to start completion: require 'thread'
require 'atomic'

class ProgressTicker

  def initialize(opts = {}, &block)
    @frequency = opts[:frequency_seconds] || 5
    @ticks = 0

    @last_tick = Atomic.new(nil)
    
    
  def each(&client)
    @tick_to_client_thread = Thread.new do
      client.call("[\n")
      while !@finished.value
        tick_for_client = @last_tick.value

        flush_statuses(client)

        if tick_for_client
          client.call(ASUtils.to_json(tick_for_client) + ",\n")
        end

        sleep @frequency
      end