Skip to content

Commit

Permalink
Move implemented position
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Feb 6, 2024
1 parent b265dbf commit a4ad8ac
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions ext/ilios/cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,35 +135,34 @@ static VALUE cluster_keyspace(VALUE self, VALUE keyspace)
}

/**
* Sets the timeout for connecting to a node.
* Default is +5000+ milliseconds.
* Sets the protocol version. The driver will automatically downgrade to the lowest supported protocol version.
* Default is +PROTOCOL_VERSION_V4+.
*
* @param timeout_ms [Integer] A connect timeout in milliseconds.
* @return [Cassandra::Cluster] self.
*/
static VALUE cluster_connect_timeout(VALUE self, VALUE timeout_ms)
static VALUE cluster_protocol_version(VALUE self, VALUE version)
{
CassandraCluster *cassandra_cluster;

GET_CLUSTER(self, cassandra_cluster);
cass_cluster_set_connect_timeout(cassandra_cluster->cluster, NUM2UINT(timeout_ms));
cass_cluster_set_protocol_version(cassandra_cluster->cluster, NUM2INT(version));

return self;
}

/**
* Sets the protocol version. The driver will automatically downgrade to the lowest supported protocol version.
* Default is +PROTOCOL_VERSION_V4+.
* Sets the timeout for connecting to a node.
* Default is +5000+ milliseconds.
*
* @param timeout_ms [Integer] A connect timeout in milliseconds.
* @return [Cassandra::Cluster] self.
*/
static VALUE cluster_protocol_version(VALUE self, VALUE version)
static VALUE cluster_connect_timeout(VALUE self, VALUE timeout_ms)
{
CassandraCluster *cassandra_cluster;

GET_CLUSTER(self, cassandra_cluster);
cass_cluster_set_protocol_version(cassandra_cluster->cluster, NUM2INT(version));
cass_cluster_set_connect_timeout(cassandra_cluster->cluster, NUM2UINT(timeout_ms));

return self;
}
Expand Down

0 comments on commit a4ad8ac

Please sign in to comment.