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: apns_pusher.rb
    path of file: ./repos/ruby-push-notifications/lib/ruby-push-notifications/apns
    
    the code of the file until where you have to start completion: 
module RubyPushNotifications
  module APNS
    # This class coordinates the process of sending notificati
    
      def push(notifications)
        conn = APNSConnection.open @certificate, @sandbox, @pass, @options

        binaries = notifications.each_with_object([]) do |notif, binaries|
          notif.each_message(binaries.count) do |msg|
            binaries << msg
          end
        end

        results = []
        i = 0
        while i < binaries.count
          conn.write binaries[i]

          if i == binaries.count-1
            conn.flush
            rs, = IO.select([conn], nil, nil, 2)
          else
            rs, = IO.select([conn], [conn])
          end