ilios 0.4.5 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/ilios/cluster.c +8 -8
- data/ext/ilios/future.c +17 -4
- 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: 7794c439a6a3b6c6f0362b2b1d4b20b553727473320921d6c370a524e6863c39
|
4
|
+
data.tar.gz: 8d01681e24c7b822f3a4e96837f4682cbb139527c1660a1d2db7371ff9cba551
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b2e96c2adcf02b602ba9e97d2ba25bbecd3816106519ab3b61e97f814df033f01650bbd2a99fc9b7475f26e2cc598c6a864b1098215a9742be65ee80a3695ad
|
7
|
+
data.tar.gz: 3d5ca806b3f682fe2427e3f3cd091ceacd8a98e5894479ddf6bd5cbcb721f58ca4e64cb4a2e3e318b7aff36ed09a851791d04403cc185d4f03adbefeb045c385
|
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)
|
@@ -290,7 +303,7 @@ static VALUE future_await(VALUE self)
|
|
290
303
|
GET_FUTURE(self, cassandra_future);
|
291
304
|
|
292
305
|
if (cassandra_future->already_waited) {
|
293
|
-
|
306
|
+
return self;
|
294
307
|
}
|
295
308
|
|
296
309
|
if (cassandra_future->on_success_block || cassandra_future->on_failure_block) {
|
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.7
|
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-08 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.7
|
81
81
|
rubygems_mfa_required: 'true'
|
82
82
|
post_install_message:
|
83
83
|
rdoc_options: []
|