ilios 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/ilios/cluster.c +8 -8
- data/ext/ilios/future.c +16 -3
- data/ext/ilios/ilios.c +4 -0
- data/ext/ilios/ilios.h +2 -0
- data/lib/ilios/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfc0036bce9b2d84aa66c517c58772bc084a8377997953b149c8192e660d836a
|
4
|
+
data.tar.gz: be99b813f53b6abe7d1faa86fe7006e34c202d65928c64f41893c68a77cd9275
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55fe1cc2ea9e157e81f6d52fd54aeb2e5259f5ce3e078f54260abe76423280464752e3591da167c26c1dd783413cda5ae202f884a7df3d0625ee719724b03673
|
7
|
+
data.tar.gz: c2315325480d67a765d0f9b8588649b9bfdc8a99fe2489c4013090faf1d9f44f3f3458258d842aab2203b49d9385fb84393b01b113f9e4debdd58a34060b29cf
|
data/ext/ilios/cluster.c
CHANGED
@@ -135,35 +135,35 @@ static VALUE cluster_keyspace(VALUE self, VALUE keyspace)
|
|
135
135
|
}
|
136
136
|
|
137
137
|
/**
|
138
|
-
* Sets the
|
139
|
-
* Default is +
|
138
|
+
* Sets the protocol version. The driver will automatically downgrade to the lowest supported protocol version.
|
139
|
+
* Default is +PROTOCOL_VERSION_V4+.
|
140
140
|
*
|
141
141
|
* @param timeout_ms [Integer] A connect timeout in milliseconds.
|
142
142
|
* @return [Cassandra::Cluster] self.
|
143
143
|
*/
|
144
|
-
static VALUE
|
144
|
+
static VALUE cluster_protocol_version(VALUE self, VALUE version)
|
145
145
|
{
|
146
146
|
CassandraCluster *cassandra_cluster;
|
147
147
|
|
148
148
|
GET_CLUSTER(self, cassandra_cluster);
|
149
|
-
|
149
|
+
cass_cluster_set_protocol_version(cassandra_cluster->cluster, NUM2INT(version));
|
150
150
|
|
151
151
|
return self;
|
152
152
|
}
|
153
153
|
|
154
154
|
/**
|
155
|
-
* Sets the
|
156
|
-
* Default is +
|
155
|
+
* Sets the timeout for connecting to a node.
|
156
|
+
* Default is +5000+ milliseconds.
|
157
157
|
*
|
158
158
|
* @param timeout_ms [Integer] A connect timeout in milliseconds.
|
159
159
|
* @return [Cassandra::Cluster] self.
|
160
160
|
*/
|
161
|
-
static VALUE
|
161
|
+
static VALUE cluster_connect_timeout(VALUE self, VALUE timeout_ms)
|
162
162
|
{
|
163
163
|
CassandraCluster *cassandra_cluster;
|
164
164
|
|
165
165
|
GET_CLUSTER(self, cassandra_cluster);
|
166
|
-
|
166
|
+
cass_cluster_set_connect_timeout(cassandra_cluster->cluster, NUM2UINT(timeout_ms));
|
167
167
|
|
168
168
|
return self;
|
169
169
|
}
|
data/ext/ilios/future.c
CHANGED
@@ -33,10 +33,23 @@ static void future_thread_pool_init(future_thread_pool *pool)
|
|
33
33
|
{
|
34
34
|
pool->queue = rb_funcall(cQueue, id_new, 0);
|
35
35
|
rb_gc_register_mark_object(pool->queue);
|
36
|
+
}
|
37
|
+
|
38
|
+
static void future_thread_pool_prepare_thread(future_thread_pool *pool)
|
39
|
+
{
|
40
|
+
VALUE status;
|
36
41
|
|
37
42
|
for (int i = 0; i < THREAD_MAX; i++) {
|
38
|
-
|
39
|
-
|
43
|
+
status = Qfalse;
|
44
|
+
|
45
|
+
if (pool->thread[i]) {
|
46
|
+
status = rb_funcall(pool->thread[i], id_alive, 0);
|
47
|
+
}
|
48
|
+
if (!pool->thread[i] || !RTEST(status)) {
|
49
|
+
pool->thread[i] = rb_thread_create(future_result_yielder_thread, (void*)pool);
|
50
|
+
rb_funcall(pool->thread[i], id_report_on_exception, 1, Qtrue);
|
51
|
+
rb_gc_register_address(&pool->thread[i]);
|
52
|
+
}
|
40
53
|
}
|
41
54
|
}
|
42
55
|
|
@@ -58,6 +71,7 @@ static inline future_thread_pool *future_thread_pool_get(CassandraFuture *cassan
|
|
58
71
|
static inline void future_queue_push(future_thread_pool *pool, VALUE future)
|
59
72
|
{
|
60
73
|
rb_funcall(pool->queue, id_push, 1, future);
|
74
|
+
future_thread_pool_prepare_thread(pool);
|
61
75
|
}
|
62
76
|
|
63
77
|
static inline VALUE future_queue_pop(future_thread_pool *pool)
|
@@ -137,7 +151,6 @@ static VALUE future_result_yielder_body(VALUE future)
|
|
137
151
|
|
138
152
|
nogvl_future_wait(cassandra_future->future);
|
139
153
|
return rb_mutex_synchronize(cassandra_future->proc_mutex, future_result_yielder_synchronize, future);
|
140
|
-
|
141
154
|
}
|
142
155
|
|
143
156
|
static VALUE future_result_yielder_ensure(VALUE future)
|
data/ext/ilios/ilios.c
CHANGED
@@ -17,6 +17,8 @@ VALUE id_to_time;
|
|
17
17
|
VALUE id_new;
|
18
18
|
VALUE id_push;
|
19
19
|
VALUE id_pop;
|
20
|
+
VALUE id_alive;
|
21
|
+
VALUE id_report_on_exception;
|
20
22
|
VALUE sym_unsupported_column_type;
|
21
23
|
|
22
24
|
#if defined(HAVE_MALLOC_USABLE_SIZE)
|
@@ -77,6 +79,8 @@ void Init_ilios(void)
|
|
77
79
|
id_new = rb_intern("new");
|
78
80
|
id_push = rb_intern("push");
|
79
81
|
id_pop = rb_intern("pop");
|
82
|
+
id_alive = rb_intern("alive?");
|
83
|
+
id_report_on_exception = rb_intern("report_on_exception=");
|
80
84
|
sym_unsupported_column_type = ID2SYM(rb_intern("unsupported_column_type"));
|
81
85
|
|
82
86
|
Init_cluster();
|
data/ext/ilios/ilios.h
CHANGED
data/lib/ilios/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ilios
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Watson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mini_portile2
|
@@ -77,7 +77,7 @@ metadata:
|
|
77
77
|
homepage_uri: https://github.com/Watson1978/ilios
|
78
78
|
source_code_uri: https://github.com/Watson1978/ilios
|
79
79
|
bug_tracker_uri: https://github.com/Watson1978/ilios/issues
|
80
|
-
documentation_uri: https://www.rubydoc.info/gems/ilios/0.4.
|
80
|
+
documentation_uri: https://www.rubydoc.info/gems/ilios/0.4.6
|
81
81
|
rubygems_mfa_required: 'true'
|
82
82
|
post_install_message:
|
83
83
|
rdoc_options: []
|