Class: Cql::Client::SynchronousClient

Inherits:
Client
  • Object
show all
Includes:
SynchronousBacktrace
Defined in:
lib/cql/client/synchronous_client.rb

Instance Method Summary collapse

Methods included from SynchronousBacktrace

#synchronous_backtrace

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

#asyncObject



62
63
64
# File 'lib/cql/client/synchronous_client.rb', line 62

def async
  @async_client
end

#closeObject



36
37
38
39
# File 'lib/cql/client/synchronous_client.rb', line 36

def close
  synchronous_backtrace { @async_client.close.value }
  self
end

#connectObject



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

Returns:

  • (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

#keyspaceObject



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