Class: Async::MySQL::Client
- Inherits:
-
Wrapper
- Object
- Wrapper
- Async::MySQL::Client
show all
- Defined in:
- lib/async/mysql/client.rb
Instance Method Summary
collapse
Constructor Details
#initialize(config, reactor = nil) ⇒ Client
Returns a new instance of Client.
28
29
30
31
32
|
# File 'lib/async/mysql/client.rb', line 28
def initialize(config, reactor = nil)
@client = ::Mysql2::Client.new(config)
super(::IO.for_fd(@client.socket), reactor)
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object
46
47
48
|
# File 'lib/async/mysql/client.rb', line 46
def method_missing(*args)
@client.send(*args)
end
|
Instance Method Details
#query(sql, **options) ⇒ Object
34
35
36
37
38
39
40
|
# File 'lib/async/mysql/client.rb', line 34
def query(sql, **options)
@client.query(sql, async: true, **options)
wait_readable
return @client.async_result
end
|
#respond_to?(*args) ⇒ Boolean
42
43
44
|
# File 'lib/async/mysql/client.rb', line 42
def respond_to?(*args)
@client.respond_to(*args)
end
|