Sha256: 746e3d7e8e74d1d59b3b5f11dbbebd9e36874c033a71103d009c9e122cc32130

Contents?: true

Size: 366 Bytes

Versions: 21

Compression:

Stored size: 366 Bytes

Contents

# frozen_string_literal: true

require_relative '../../polyphony'
require 'mysql2/client'

# Mysql2::Client overrides
Mysql2::Client.prepend(Module.new do
  def initialize(config)
    config[:async] = true
    super
    @io = ::IO.for_fd(socket)
  end

  def query(sql, **options)
    super
    Thread.current.backend.wait_io(@io, false)
    async_result
  end
end)

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
polyphony-0.51.0 lib/polyphony/adapters/mysql2.rb
polyphony-0.50.1 lib/polyphony/adapters/mysql2.rb
polyphony-0.50.0 lib/polyphony/adapters/mysql2.rb
polyphony-0.49.2 lib/polyphony/adapters/mysql2.rb
polyphony-0.49.1 lib/polyphony/adapters/mysql2.rb
polyphony-0.49.0 lib/polyphony/adapters/mysql2.rb
polyphony-0.48.0 lib/polyphony/adapters/mysql2.rb
polyphony-0.47.5.1 lib/polyphony/adapters/mysql2.rb
polyphony-0.47.5 lib/polyphony/adapters/mysql2.rb
polyphony-0.47.4 lib/polyphony/adapters/mysql2.rb
polyphony-0.47.3 lib/polyphony/adapters/mysql2.rb
polyphony-0.47.2 lib/polyphony/adapters/mysql2.rb
polyphony-0.47.1 lib/polyphony/adapters/mysql2.rb
polyphony-0.47.0 lib/polyphony/adapters/mysql2.rb
polyphony-0.46.1 lib/polyphony/adapters/mysql2.rb
polyphony-0.46.0 lib/polyphony/adapters/mysql2.rb
polyphony-0.45.5 lib/polyphony/adapters/mysql2.rb
polyphony-0.45.4 lib/polyphony/adapters/mysql2.rb
polyphony-0.45.2 lib/polyphony/adapters/mysql2.rb
polyphony-0.45.1 lib/polyphony/adapters/mysql2.rb