couchbase 1.2.0 → 1.2.1
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.
- data/RELEASE_NOTES.markdown +98 -85
- data/ext/couchbase_ext/multithread_plugin.c +54 -17
- data/ext/couchbase_ext/store.c +2 -1
- data/lib/couchbase/version.rb +1 -1
- metadata +4 -4
data/RELEASE_NOTES.markdown
CHANGED
@@ -3,116 +3,129 @@
|
|
3
3
|
This document is a list of user visible feature changes and important
|
4
4
|
bugfixes. Do not forget to update this doc in every important patch.
|
5
5
|
|
6
|
+
## 1.2.1 (2012-12-28)
|
7
|
+
|
8
|
+
* [major] RCBC-101 Persistence constraints were not passed to mutation
|
9
|
+
methods, so they were not applied properly.
|
10
|
+
|
11
|
+
* [major] RCBC-102 Inconsistent return values in case of storage
|
12
|
+
functions with persistence constraints. It always returns a Hash
|
13
|
+
in case of multi-set, even if there is only one document is being
|
14
|
+
set.
|
15
|
+
|
16
|
+
* [minor] Improve internal structures of multi-threaded IO plugin to
|
17
|
+
protect it from memory leaks when the Fiber object is forgotten.
|
18
|
+
|
6
19
|
## 1.2.0 (2012-12-12)
|
7
20
|
|
8
21
|
30 files changed, 2079 insertions(+), 662 deletions(-)
|
9
22
|
|
10
|
-
*
|
23
|
+
* New specialized io plugin for releasing Ruby GVL (thanks to
|
11
24
|
Sokolov Yura aka funny_falcon).
|
12
25
|
|
13
|
-
* Ruby 1.9.x uses global lock for ensuring integrity, and blocking
|
26
|
+
* Ruby 1.9.x uses a global lock for ensuring integrity, and blocking
|
14
27
|
calls should be called inside rb_thread_blocking_region to allow
|
15
|
-
other threads to be
|
28
|
+
other threads to be run.
|
16
29
|
|
17
|
-
* Ruby 1.8.7
|
30
|
+
* Ruby 1.8.7 has only green threads, so rb_thread_schedule
|
18
31
|
should be called manually.
|
19
32
|
|
20
|
-
* RCBC-42 Catch exceptions from ruby callbacks
|
33
|
+
* RCBC-42 Catch exceptions from ruby callbacks.
|
21
34
|
|
22
|
-
* RCBC-99 read out the StringIO contents in json gem monkey patch
|
35
|
+
* RCBC-99 read out the StringIO contents in json gem monkey patch.
|
23
36
|
|
24
|
-
* Use marshal serializer by default for session store
|
37
|
+
* Use marshal serializer by default for session store.
|
25
38
|
|
26
|
-
* Remove debugger development dependency
|
39
|
+
* Remove debugger development dependency.
|
27
40
|
|
28
|
-
* Fix memory leaks and performance improvements
|
41
|
+
* Fix memory leaks and performance improvements.
|
29
42
|
|
30
43
|
## 1.2.0.z.beta5 (2012-11-29)
|
31
44
|
|
32
45
|
25 files changed, 1419 insertions(+), 1230 deletions(-)
|
33
46
|
|
34
|
-
* RCBC-95 Use response body to clarify Couchbase::Error::HTTP
|
47
|
+
* RCBC-95 Use response body to clarify Couchbase::Error::HTTP.
|
35
48
|
|
36
|
-
* Fix memory leaks: in async mode context wasn't freed
|
49
|
+
* Fix memory leaks: in async mode context wasn't freed.
|
37
50
|
|
38
|
-
* Allow to setup default initial value for INCR/DECR on per
|
39
|
-
level.
|
51
|
+
* Allow caller to setup default initial value for INCR/DECR on per
|
52
|
+
connection level.
|
40
53
|
|
41
|
-
* Make error message about libcouchbase dependency more verbose
|
54
|
+
* Make error message about libcouchbase dependency more verbose.
|
42
55
|
|
43
56
|
## 1.2.0.z.beta4 (2012-11-21)
|
44
57
|
|
45
58
|
27 files changed, 311 insertions(+), 123 deletions(-)
|
46
59
|
|
47
|
-
* Increase default connection timeout for Views up to 75 seconds
|
60
|
+
* Increase default connection timeout for Views up to 75 seconds.
|
48
61
|
|
49
|
-
* RCBC-94 Reset global exception after usage
|
62
|
+
* RCBC-94 Reset global exception after usage.
|
50
63
|
|
51
64
|
* RCBC-89 Do not expose docs embedded in HTTP response. Use binary
|
52
65
|
protocol for it.
|
53
66
|
|
54
67
|
* Remove all_docs mentions. It isn't recommended to use it because of
|
55
|
-
performance
|
68
|
+
performance and support concerns.
|
56
69
|
|
57
70
|
* Protect against non string values in :plain mode. Will raise error
|
58
71
|
if the value given isn't a string.
|
59
72
|
|
60
|
-
* RCBC-90 Update documentation about session store
|
73
|
+
* RCBC-90 Update documentation about session store.
|
61
74
|
|
62
|
-
* Make rack session store adapter quiet
|
75
|
+
* Make rack session store adapter quiet.
|
63
76
|
|
64
|
-
* Update to recent libcouchbase API
|
77
|
+
* Update to recent libcouchbase API.
|
65
78
|
|
66
|
-
* Adjust version check for MultiJson monkeypatch (8098da1)
|
79
|
+
* Adjust version check for MultiJson monkeypatch (8098da1).
|
67
80
|
|
68
|
-
* Do not hide ValueFormat reason
|
81
|
+
* Do not hide ValueFormat reason.
|
69
82
|
|
70
83
|
## 1.2.0.z.beta3 (2012-10-16)
|
71
84
|
|
72
85
|
18 files changed, 241 insertions(+), 57 deletions(-)
|
73
86
|
|
74
|
-
* RCBC-52 Implement bucket create/delete operations
|
87
|
+
* RCBC-52 Implement bucket create/delete operations.
|
75
88
|
|
76
|
-
* Propogate status code for HTTP responses
|
89
|
+
* Propogate status code for HTTP responses.
|
77
90
|
|
78
|
-
* RCBC-87 Fix build error on macos
|
91
|
+
* RCBC-87 Fix build error on macos.
|
79
92
|
|
80
|
-
* Use global scope to find Error classes (thanks to @wr0ngway)
|
93
|
+
* Use global scope to find Error classes (thanks to @wr0ngway).
|
81
94
|
|
82
|
-
* Fix memory leaks
|
95
|
+
* Fix memory leaks.
|
83
96
|
|
84
|
-
* Update to recent libcouchbase API
|
97
|
+
* Update to recent libcouchbase API.
|
85
98
|
|
86
99
|
## 1.2.0.z.beta2 (2012-09-21)
|
87
100
|
|
88
101
|
3 files changed, 6 insertions(+), 2 deletions(-)
|
89
102
|
|
90
|
-
* RCBC-82 Not all rubies are fat on MacOS. Fixes build
|
103
|
+
* RCBC-82 Not all rubies are fat on MacOS. Fixes build.
|
91
104
|
|
92
105
|
## 1.2.0.z.beta (2012-09-18)
|
93
106
|
|
94
107
|
2 files changed, 5 insertions(+), 1 deletion(-)
|
95
108
|
|
96
|
-
* Fix version ordering by using ".z" prefix before .beta
|
109
|
+
* Fix version ordering by using ".z" prefix before .beta.
|
97
110
|
|
98
111
|
## 1.2.0.beta (2012-09-18)
|
99
112
|
|
100
113
|
51 files changed, 9301 insertions(+), 3364 deletions(-)
|
101
114
|
|
102
115
|
* RCBC-81 Protect against NoMethodError in extconf.rb. Fixes
|
103
|
-
gem installation
|
116
|
+
gem installation.
|
104
117
|
|
105
|
-
* RCBC-79 Use RESTful flush
|
118
|
+
* RCBC-79 Use RESTful flush.
|
106
119
|
|
107
|
-
* Various build fixes
|
120
|
+
* Various build fixes.
|
108
121
|
|
109
|
-
* Add attribute reader for Error::Base status code
|
122
|
+
* Add attribute reader for Error::Base status code.
|
110
123
|
|
111
|
-
* CCBC-98 Expose client temporary failure error
|
124
|
+
* CCBC-98 Expose client temporary failure error.
|
112
125
|
|
113
|
-
* RCBC-28 Implement Bucket#unlock
|
126
|
+
* RCBC-28 Implement Bucket#unlock.
|
114
127
|
|
115
|
-
* Fix CAS conversion for Bucket#delete method for 32-bit systems
|
128
|
+
* Fix CAS conversion for Bucket#delete method for 32-bit systems.
|
116
129
|
|
117
130
|
## 1.1.5 (2012-09-17)
|
118
131
|
|
@@ -124,10 +137,10 @@ bugfixes. Do not forget to update this doc in every important patch.
|
|
124
137
|
|
125
138
|
5 files changed, 64 insertions(+), 30 deletions(-)
|
126
139
|
|
127
|
-
* RCBC-37 Allow to pass intial list of nodes which will
|
128
|
-
iterate addresses until alive node
|
140
|
+
* RCBC-37 Allow app to pass intial list of nodes which will let client
|
141
|
+
iterate addresses until an alive node is found.
|
129
142
|
|
130
|
-
Couchbase.connect(:node_list => ['example.com:8091', 'example.org:8091', 'example.
|
143
|
+
Couchbase.connect(:node_list => ['node1.example.com:8091', 'node2.example.org:8091', 'node3.example.com:8091'])
|
131
144
|
|
132
145
|
* RCBC-70 Fixed UTF-8 in the keys. Original discussion
|
133
146
|
https://groups.google.com/d/topic/couchbase/bya0lSf9uGE/discussion
|
@@ -139,23 +152,23 @@ bugfixes. Do not forget to update this doc in every important patch.
|
|
139
152
|
* RCBC-47 Allow to skip username for protected buckets. The will use
|
140
153
|
bucket name for credentials.
|
141
154
|
|
142
|
-
* Expose number of replicas to the user
|
155
|
+
* Expose the number of replicas to the user.
|
143
156
|
|
144
|
-
* RCBC-6 Implement OBSERVE command
|
157
|
+
* RCBC-6 Implement OBSERVE command.
|
145
158
|
|
146
|
-
* RCBC-49 :observe option for storage functions
|
159
|
+
* RCBC-49 :observe option for storage functions.
|
147
160
|
|
148
|
-
* RCBC-50 Allow to read keys from replica
|
161
|
+
* RCBC-50 Allow to read keys from replica.
|
149
162
|
|
150
|
-
* RCBC-57 Expose timers API from libcouchbase
|
163
|
+
* RCBC-57 Expose timers API from libcouchbase.
|
151
164
|
|
152
|
-
* RCBC-59 Replicate flags in Bucket#cas operation
|
165
|
+
* RCBC-59 Replicate flags in Bucket#cas operation.
|
153
166
|
|
154
167
|
* Apply timeout value before connection. Currently libcouchbase shares
|
155
168
|
timeouts for connection and IO operations. This patch allows to
|
156
|
-
setup timeout
|
169
|
+
setup a timeout when instantiating the connection.
|
157
170
|
|
158
|
-
* RCBC-39 Allow to specify delta for incr/decr in options
|
171
|
+
* RCBC-39 Allow to specify delta for incr/decr in options.
|
159
172
|
|
160
173
|
* RCBC-40 Fix Bucket#cas operation behaviour in async mode. The
|
161
174
|
callback of the Bucket#cas method is triggered only once, when it
|
@@ -179,9 +192,9 @@ bugfixes. Do not forget to update this doc in every important patch.
|
|
179
192
|
end
|
180
193
|
c.get("foo") #=> {"bar" => 1, "baz" => 2}
|
181
194
|
|
182
|
-
* RCBC-43 More docs and examples on views
|
195
|
+
* RCBC-43 More docs and examples on views.
|
183
196
|
|
184
|
-
* RCBC-37 Bootstrapping using multiple nodes
|
197
|
+
* RCBC-37 Bootstrapping using multiple nodes.
|
185
198
|
|
186
199
|
Couchbase.connect(:node_list => ['example.com:8091', 'example.org:8091', 'example.net'])
|
187
200
|
|
@@ -191,7 +204,7 @@ bugfixes. Do not forget to update this doc in every important patch.
|
|
191
204
|
|
192
205
|
12 files changed, 939 insertions(+), 20 deletions(-)
|
193
206
|
|
194
|
-
* Integrate with Rack and Rails session store
|
207
|
+
* Integrate with Rack and Rails session store.
|
195
208
|
|
196
209
|
# rack
|
197
210
|
require 'rack/session/couchbase'
|
@@ -201,7 +214,7 @@ bugfixes. Do not forget to update this doc in every important patch.
|
|
201
214
|
require 'action_dispatch/middleware/session/couchbase_store'
|
202
215
|
AppName::Application.config.session_store :couchbase_store
|
203
216
|
|
204
|
-
* Implement cache store adapter for Rails
|
217
|
+
* Implement cache store adapter for Rails.
|
205
218
|
|
206
219
|
cache_options = {
|
207
220
|
:bucket => 'protected',
|
@@ -211,11 +224,11 @@ bugfixes. Do not forget to update this doc in every important patch.
|
|
211
224
|
}
|
212
225
|
config.cache_store = :couchbase_store, cache_options
|
213
226
|
|
214
|
-
* Implement key prefix (simple namespacing)
|
227
|
+
* Implement key prefix (simple namespacing).
|
215
228
|
|
216
229
|
Couchbase.connect(:key_prefix => "prefix:")
|
217
230
|
|
218
|
-
* Allow to force assembling result Hash for multi-get
|
231
|
+
* Allow to force assembling result Hash for multi-get.
|
219
232
|
|
220
233
|
connection.get("foo", "bar")
|
221
234
|
#=> [1, 2]
|
@@ -226,7 +239,7 @@ bugfixes. Do not forget to update this doc in every important patch.
|
|
226
239
|
|
227
240
|
4 files changed, 34 insertions(+), 19 deletions(-)
|
228
241
|
|
229
|
-
* Update replace documentation: it accepts :cas option
|
242
|
+
* Update replace documentation: it accepts :cas option.
|
230
243
|
|
231
244
|
* RCBC-36 Fix segfault. Ocassional segfault when accessing the
|
232
245
|
results of a View. https://gist.github.com/2883925
|
@@ -235,10 +248,10 @@ bugfixes. Do not forget to update this doc in every important patch.
|
|
235
248
|
|
236
249
|
4 files changed, 22 insertions(+), 4 deletions(-)
|
237
250
|
|
238
|
-
* Fix for multi_json < 1.3.3
|
251
|
+
* Fix for multi_json < 1.3.3.
|
239
252
|
|
240
253
|
* Break out from event loop for non-chunked responses (fix creating
|
241
|
-
design create)
|
254
|
+
design create).
|
242
255
|
|
243
256
|
## 1.2.0.dp2 (2012-06-06)
|
244
257
|
|
@@ -254,11 +267,11 @@ bugfixes. Do not forget to update this doc in every important patch.
|
|
254
267
|
get("foo") #=> "bar"
|
255
268
|
get(["x"], :extended => true) #=> {"x"=>["xval", 0, 18336939621176836096]}
|
256
269
|
|
257
|
-
* Use monotonic high resolution clock
|
270
|
+
* Use monotonic high resolution clock.
|
258
271
|
|
259
|
-
* Implement threshold for outgoing commands
|
272
|
+
* Implement threshold for outgoing commands.
|
260
273
|
|
261
|
-
* Allow to
|
274
|
+
* Allow event loop to be stopped from ruby.
|
262
275
|
|
263
276
|
* RCBC-35 Fix the View parameters escaping. More info at
|
264
277
|
https://gist.github.com/2775050
|
@@ -268,17 +281,17 @@ bugfixes. Do not forget to update this doc in every important patch.
|
|
268
281
|
various gems. The most compatible way to use yajl is to call
|
269
282
|
Yajl::Parser and Yajl::Encoder directly.
|
270
283
|
|
271
|
-
* Allow
|
284
|
+
* Allow block and wait for part of the request.
|
272
285
|
|
273
|
-
* Fix view iterator
|
286
|
+
* Fix view iterator to not lock the event loop anymore.
|
274
287
|
|
275
|
-
* Define views only if "views" key presented
|
288
|
+
* Define views only if "views" key presented.
|
276
289
|
|
277
|
-
* Require yajl as development dependency
|
290
|
+
* Require yajl as development dependency.
|
278
291
|
|
279
|
-
* Implement get with lock operation
|
292
|
+
* Implement get with lock operation.
|
280
293
|
|
281
|
-
* Update documentation
|
294
|
+
* Update documentation.
|
282
295
|
|
283
296
|
## 1.1.3 (2012-07-27)
|
284
297
|
|
@@ -411,28 +424,28 @@ bugfixes. Do not forget to update this doc in every important patch.
|
|
411
424
|
* marshal
|
412
425
|
* plain
|
413
426
|
|
414
|
-
* Removed Views support
|
427
|
+
* Removed Views support.
|
415
428
|
|
416
429
|
* Added benchmarks, couchbase vs. memcached vs. dalli
|
417
430
|
|
418
|
-
* Implement asynchronous protocol
|
431
|
+
* Implement asynchronous protocol.
|
419
432
|
|
420
|
-
* e36c2e7 Implement basic commands
|
433
|
+
* e36c2e7 Implement basic commands.
|
421
434
|
|
422
435
|
## 0.9.8 (2011-12-16)
|
423
436
|
|
424
437
|
3 files changed, 8 insertions(+), 3 deletions(-)
|
425
438
|
|
426
439
|
* RCBC-10 Always specify credentials for non-default buckets. It was
|
427
|
-
impossible to store data in non-default buckets
|
440
|
+
impossible to store data in non-default buckets.
|
428
441
|
|
429
442
|
## 0.9.7 (2011-10-05)
|
430
443
|
|
431
444
|
7 files changed, 31 insertions(+), 19 deletions(-)
|
432
445
|
|
433
|
-
* Fix design doc
|
446
|
+
* Fix design doc removal.
|
434
447
|
|
435
|
-
* Fix 'set' method signature: add missing options argument
|
448
|
+
* Fix 'set' method signature: add missing options argument.
|
436
449
|
|
437
450
|
* Rename gem to 'couchbase' for easy of use. The github project still
|
438
451
|
is 'couchbase-ruby-client'
|
@@ -455,29 +468,29 @@ bugfixes. Do not forget to update this doc in every important patch.
|
|
455
468
|
|
456
469
|
4 files changed, 59 insertions(+), 28 deletions(-)
|
457
470
|
|
458
|
-
* Update README. Make it more human-friendly
|
471
|
+
* Update README. Make it more human-friendly.
|
459
472
|
|
460
|
-
* Removed depency on will_paginate in development mode
|
473
|
+
* Removed depency on will_paginate in development mode.
|
461
474
|
|
462
475
|
## 0.9.4 (2011-08-01)
|
463
476
|
|
464
477
|
24 files changed, 1240 insertions(+), 78 deletions(-)
|
465
478
|
|
466
|
-
* Use streaming json parser to iterate over view results
|
479
|
+
* Use streaming json parser to iterate over view results.
|
467
480
|
|
468
|
-
* Update memcached gem dependency to v1.3
|
481
|
+
* Update memcached gem dependency to v1.3.
|
469
482
|
|
470
|
-
* Proxy TOUCH command to memcached client
|
483
|
+
* Proxy TOUCH command to memcached client.
|
471
484
|
|
472
|
-
* Fix minor bugs in RestClient and Document classes
|
485
|
+
* Fix minor bugs in RestClient and Document classes.
|
473
486
|
|
474
487
|
* Disable CouchDB API for nodes without 'couchApiBase' key provided.
|
475
488
|
|
476
|
-
* Fix bug with unicode parsing in config listener
|
489
|
+
* Fix bug with unicode parsing in config listener.
|
477
490
|
|
478
491
|
* 61f394e RCBC-5 Add Dave's test case: ensure memcached client
|
479
492
|
initialized. Fixes Timeout error on connecting to membase with
|
480
|
-
Couchbase.new on Ruby 1.8.7
|
493
|
+
Couchbase.new on Ruby 1.8.7.
|
481
494
|
|
482
495
|
## 0.9.3 (2011-07-29)
|
483
496
|
|
@@ -486,23 +499,23 @@ bugfixes. Do not forget to update this doc in every important patch.
|
|
486
499
|
* Use Latch (via Mutex and ConditionVariable) to wait until initial
|
487
500
|
setup will be finished.
|
488
501
|
|
489
|
-
* Update prefix for development views (from '$dev_' to 'dev_')
|
502
|
+
* Update prefix for development views (from '$dev_' to 'dev_').
|
490
503
|
|
491
504
|
## 0.9.2 (2011-07-28)
|
492
505
|
|
493
506
|
5 files changed, 31 insertions(+), 20 deletions(-)
|
494
507
|
|
495
|
-
* Use zero TTL by default to store records forever
|
508
|
+
* Use zero TTL by default to store records forever.
|
496
509
|
|
497
|
-
* Update documentation
|
510
|
+
* Update documentation.
|
498
511
|
|
499
|
-
* Wait until configuration is done
|
512
|
+
* Wait until configuration is done.
|
500
513
|
|
501
514
|
## 0.9.1 (2011-07-25)
|
502
515
|
|
503
516
|
3 files changed, 5 insertions(+), 2 deletions(-)
|
504
517
|
|
505
|
-
* Minor bugfix for RestClient initialization
|
518
|
+
* Minor bugfix for RestClient initialization.
|
506
519
|
|
507
520
|
## 0.9.0 (2011-07-25)
|
508
521
|
|
@@ -690,6 +690,22 @@ typedef struct loop_select_arg {
|
|
690
690
|
rb_fdset_t in, out;
|
691
691
|
} ls_arg;
|
692
692
|
|
693
|
+
static void
|
694
|
+
ls_arg_free(void *p) {
|
695
|
+
ls_arg *args = p;
|
696
|
+
if (args) {
|
697
|
+
rb_fd_term(&args->in);
|
698
|
+
rb_fd_term(&args->out);
|
699
|
+
xfree(args);
|
700
|
+
}
|
701
|
+
}
|
702
|
+
|
703
|
+
static VALUE
|
704
|
+
ls_arg_alloc(ls_arg **args)
|
705
|
+
{
|
706
|
+
return Data_Make_Struct(rb_cObject, ls_arg, 0, ls_arg_free, *args);
|
707
|
+
}
|
708
|
+
|
693
709
|
static VALUE
|
694
710
|
loop_run_select(VALUE argp)
|
695
711
|
{
|
@@ -776,10 +792,12 @@ loop_run_select(VALUE argp)
|
|
776
792
|
static VALUE
|
777
793
|
loop_select_cleanup(VALUE argp)
|
778
794
|
{
|
779
|
-
ls_arg *args = (
|
780
|
-
|
781
|
-
|
782
|
-
|
795
|
+
ls_arg *args = DATA_PTR(argp);
|
796
|
+
if (args) {
|
797
|
+
callbacks_clean(&args->loop->callbacks);
|
798
|
+
ls_arg_free(args);
|
799
|
+
DATA_PTR(argp) = 0;
|
800
|
+
}
|
783
801
|
return Qnil;
|
784
802
|
}
|
785
803
|
/* loop select implementaion end */
|
@@ -841,6 +859,24 @@ struct poll_args {
|
|
841
859
|
int lerrno;
|
842
860
|
};
|
843
861
|
|
862
|
+
static void
|
863
|
+
lp_arg_free(void *p)
|
864
|
+
{
|
865
|
+
lp_arg *args = p;
|
866
|
+
if (args) {
|
867
|
+
if (args->fds) {
|
868
|
+
free(args->fds);
|
869
|
+
}
|
870
|
+
xfree(args);
|
871
|
+
}
|
872
|
+
}
|
873
|
+
|
874
|
+
static VALUE
|
875
|
+
lp_arg_alloc(lp_arg **args)
|
876
|
+
{
|
877
|
+
return Data_Make_Struct(rb_cObject, lp_arg, 0, lp_arg_free, *args);
|
878
|
+
}
|
879
|
+
|
844
880
|
#ifdef HAVE_RB_THREAD_BLOCKING_REGION
|
845
881
|
static VALUE
|
846
882
|
loop_blocking_poll(void *argp)
|
@@ -855,7 +891,7 @@ loop_blocking_poll(void *argp)
|
|
855
891
|
static VALUE
|
856
892
|
loop_run_poll(VALUE argp)
|
857
893
|
{
|
858
|
-
lp_arg *args = (
|
894
|
+
lp_arg *args = (lp_arg*)argp;
|
859
895
|
rb_mt_loop *loop = args->loop;
|
860
896
|
struct timespec ts;
|
861
897
|
hrtime_t now, next_time;
|
@@ -984,11 +1020,12 @@ retry:
|
|
984
1020
|
static VALUE
|
985
1021
|
loop_poll_cleanup(VALUE argp)
|
986
1022
|
{
|
987
|
-
lp_arg *args = (
|
988
|
-
if (args
|
989
|
-
|
1023
|
+
lp_arg *args = DATA_PTR(argp);
|
1024
|
+
if (args) {
|
1025
|
+
callbacks_clean(&args->loop->callbacks);
|
1026
|
+
lp_arg_free(args);
|
1027
|
+
DATA_PTR(argp) = 0;
|
990
1028
|
}
|
991
|
-
callbacks_clean(&args->loop->callbacks);
|
992
1029
|
return Qnil;
|
993
1030
|
}
|
994
1031
|
#endif
|
@@ -1006,17 +1043,17 @@ loop_run(rb_mt_loop *loop)
|
|
1006
1043
|
lcb_socket_t max = events_max_fd(&loop->events);
|
1007
1044
|
int use_poll = max >= 128;
|
1008
1045
|
if (use_poll) {
|
1009
|
-
lp_arg args;
|
1010
|
-
|
1011
|
-
args
|
1012
|
-
rb_ensure(loop_run_poll, (VALUE)
|
1046
|
+
lp_arg *args;
|
1047
|
+
VALUE argp = lp_arg_alloc(&args);
|
1048
|
+
args->loop = loop;
|
1049
|
+
rb_ensure(loop_run_poll, (VALUE)args, loop_poll_cleanup, argp);
|
1013
1050
|
} else
|
1014
1051
|
#endif
|
1015
1052
|
{
|
1016
|
-
ls_arg args;
|
1017
|
-
|
1018
|
-
args
|
1019
|
-
rb_ensure(loop_run_select, (VALUE)
|
1053
|
+
ls_arg *args;
|
1054
|
+
VALUE argp = ls_arg_alloc(&args);
|
1055
|
+
args->loop = loop;
|
1056
|
+
rb_ensure(loop_run_select, (VALUE)args, loop_select_cleanup, argp);
|
1020
1057
|
}
|
1021
1058
|
}
|
1022
1059
|
}
|
data/ext/couchbase_ext/store.c
CHANGED
@@ -142,6 +142,7 @@ cb_bucket_store(lcb_storage_t cmd, int argc, VALUE *argv, VALUE self)
|
|
142
142
|
ctx->proc = cb_gc_protect(bucket, proc);
|
143
143
|
ctx->observe_options = cb_gc_protect(bucket, obs);
|
144
144
|
ctx->exception = Qnil;
|
145
|
+
obs = params.cmd.store.observe;
|
145
146
|
ctx->nqueries = params.cmd.store.num;
|
146
147
|
err = lcb_store(bucket->handle, (const void *)ctx,
|
147
148
|
params.cmd.store.num, params.cmd.store.ptr);
|
@@ -173,7 +174,7 @@ cb_bucket_store(lcb_storage_t cmd, int argc, VALUE *argv, VALUE self)
|
|
173
174
|
}
|
174
175
|
if (RTEST(obs)) {
|
175
176
|
cb_gc_unprotect(bucket, obs);
|
176
|
-
|
177
|
+
rv = rb_funcall(bucket->self, cb_id_observe_and_wait, 2, rv, obs);
|
177
178
|
}
|
178
179
|
if (params.cmd.store.num > 1) {
|
179
180
|
return rv; /* return as a hash {key => cas, ...} */
|
data/lib/couchbase/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: couchbase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 1
|
10
|
+
version: 1.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Couchbase
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-12-
|
18
|
+
date: 2012-12-28 00:00:00 +03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|