Class: Cql::Client::SynchronousClient
- Includes:
- SynchronousBacktrace
- Defined in:
- lib/cql/client/synchronous_client.rb
Instance Method Summary collapse
- #async ⇒ Object
- #close ⇒ Object
- #connect ⇒ Object
- #connected? ⇒ Boolean
- #execute(cql, consistency = nil) ⇒ Object
-
#initialize(async_client) ⇒ SynchronousClient
constructor
A new instance of SynchronousClient.
- #keyspace ⇒ Object
- #prepare(cql) ⇒ Object
- #use(keyspace) ⇒ Object
Methods included from SynchronousBacktrace
Constructor Details
#initialize(async_client) ⇒ SynchronousClient
Returns a new instance of SynchronousClient.
27 28 29 |
# File 'lib/cql/client/synchronous_client.rb', line 27 def initialize(async_client) @async_client = async_client end |
Instance Method Details
#async ⇒ Object
62 63 64 |
# File 'lib/cql/client/synchronous_client.rb', line 62 def async @async_client end |
#close ⇒ Object
36 37 38 39 |
# File 'lib/cql/client/synchronous_client.rb', line 36 def close synchronous_backtrace { @async_client.close.value } self end |
#connect ⇒ Object
31 32 33 34 |
# File 'lib/cql/client/synchronous_client.rb', line 31 def connect synchronous_backtrace { @async_client.connect.value } self end |
#connected? ⇒ Boolean
41 42 43 |
# File 'lib/cql/client/synchronous_client.rb', line 41 def connected? @async_client.connected? end |
#execute(cql, consistency = nil) ⇒ Object
53 54 55 |
# File 'lib/cql/client/synchronous_client.rb', line 53 def execute(cql, consistency=nil) synchronous_backtrace { @async_client.execute(cql, consistency).value } end |
#keyspace ⇒ Object
45 46 47 |
# File 'lib/cql/client/synchronous_client.rb', line 45 def keyspace @async_client.keyspace end |
#prepare(cql) ⇒ Object
57 58 59 60 |
# File 'lib/cql/client/synchronous_client.rb', line 57 def prepare(cql) async_statement = synchronous_backtrace { @async_client.prepare(cql).value } SynchronousPreparedStatement.new(async_statement) end |
#use(keyspace) ⇒ Object
49 50 51 |
# File 'lib/cql/client/synchronous_client.rb', line 49 def use(keyspace) synchronous_backtrace { @async_client.use(keyspace).value } end |