neo4j-ruby-driver 4.4.0.alpha.4 → 4.4.0.alpha.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/ruby/neo4j/driver/internal/async/inbound/inbound_message_dispatcher.rb +1 -1
- data/ruby/neo4j/driver/internal/async/network_connection.rb +15 -22
- data/ruby/neo4j/driver/internal/async/pool/channel.rb +1 -0
- data/ruby/neo4j/driver/internal/async/pool/connection_pool_impl.rb +1 -0
- data/ruby/neo4j/driver/internal/handlers/channel_releasing_reset_response_handler.rb +11 -10
- data/ruby/neo4j/driver/internal/handlers/legacy_pull_all_response_handler.rb +1 -1
- data/ruby/neo4j/driver/internal/handlers/pulln/auto_pull_response_handler.rb +1 -2
- data/ruby/neo4j/driver/internal/handlers/reset_response_handler.rb +1 -1
- data/ruby/neo4j/driver/internal/internal_driver.rb +1 -1
- data/ruby/neo4j/driver/version.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92d999b42ad79f180328388f8b50e610e35190b2efc0b5ad9f799773a3d5d006
|
4
|
+
data.tar.gz: 759f1058c5dcf0c12d970dec2793bd2f6a5600aecfcdeb43f63b19630f038fb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50d2744664faa1596e8fe964db0b083e216f58b001a4d3d7d70218752814a164d4e83ea71f5d4b4b2330432aa58d74b12875ea182bb8f99aad701a831032cc73
|
7
|
+
data.tar.gz: 5d8f9e3e8eb358d7aa494d7be74d3ee49507ff2496f346d0b5ab9defea5c92a6017e147ae51b0e128728a667ef924cdf8b7e13f69ff398a1f6f6606d24cddeef
|
data/README.md
CHANGED
@@ -42,6 +42,7 @@ This gem includes 2 different implementations: java driver wrapper and pure ruby
|
|
42
42
|
## Testing
|
43
43
|
|
44
44
|
To run the tests the following tools need to be installed:
|
45
|
+
|
45
46
|
$ brew install python
|
46
47
|
$ pip3 install --user git+https://github.com/klobuczek/boltkit@1.3#egg=boltkit
|
47
48
|
$ neoctrl-install -e 4.4.5 servers
|
@@ -151,7 +151,7 @@ module Neo4j::Driver
|
|
151
151
|
@auto_read_managing_handler.disable_auto_read_management
|
152
152
|
|
153
153
|
# restore the default value of auto-read
|
154
|
-
@channel.
|
154
|
+
@channel.auto_read = true
|
155
155
|
end
|
156
156
|
|
157
157
|
@auto_read_managing_handler = new_handler
|
@@ -33,11 +33,11 @@ module Neo4j::Driver
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def enable_auto_read
|
36
|
-
|
36
|
+
@channel.auto_read = true if open?
|
37
37
|
end
|
38
38
|
|
39
39
|
def disable_auto_read
|
40
|
-
|
40
|
+
@channel.auto_read = false if open?
|
41
41
|
end
|
42
42
|
|
43
43
|
def flush
|
@@ -69,13 +69,12 @@ module Neo4j::Driver
|
|
69
69
|
|
70
70
|
def release
|
71
71
|
if @status.compare_and_set(Status::OPEN, Status::RELEASED)
|
72
|
-
|
72
|
+
handler = Handlers::ChannelReleasingResetResponseHandler.new(@channel, @channel_pool, @message_dispatcher, @log, @release)
|
73
|
+
write_reset_message_if_needed(handler, false)
|
74
|
+
# @metrics_listener.after_connection_released(Connection::ChannelAttributes.pool_id(@channel), @in_use_event)
|
75
|
+
# end
|
76
|
+
# @release_future
|
73
77
|
end
|
74
|
-
# handler = Handlers::ChannelReleasingResetResponseHandler.new(@channel, @channel_pool, @message_dispatcher, @clock, @release)
|
75
|
-
# write_reset_message_if_needed(handler, false)
|
76
|
-
# @metrics_listener.after_connection_released(Connection::ChannelAttributes.pool_id(@channel), @in_use_event)
|
77
|
-
# end
|
78
|
-
# @release_future
|
79
78
|
end
|
80
79
|
|
81
80
|
def terminate_and_release(reason)
|
@@ -91,15 +90,13 @@ module Neo4j::Driver
|
|
91
90
|
private
|
92
91
|
|
93
92
|
def write_reset_message_if_needed(reset_handler, is_session_reset)
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
@channel.write_and_flush(Messaging::Request::ResetMessage::RESET).add_listener(-> (_future) { register_connection_read_timeout(@channel) })
|
102
|
-
end
|
93
|
+
if is_session_reset && !open?
|
94
|
+
reset_handler.on_success
|
95
|
+
else
|
96
|
+
# auto-read could've been disabled, re-enable it to automatically receive response for RESET
|
97
|
+
@channel.auto_read = true
|
98
|
+
@message_dispatcher.enqueue(reset_handler)
|
99
|
+
@channel.write_and_flush(Messaging::Request::ResetMessage::RESET)#.add_listener(-> (_future) { register_connection_read_timeout(@channel) })
|
103
100
|
end
|
104
101
|
end
|
105
102
|
|
@@ -114,7 +111,7 @@ module Neo4j::Driver
|
|
114
111
|
@message_dispatcher.enqueue(handler)
|
115
112
|
|
116
113
|
if flush
|
117
|
-
@channel.write_and_flush(message)#.add_listener(-> (_future) { register_connection_read_timeout(@channel) })
|
114
|
+
@channel.write_and_flush(message) #.add_listener(-> (_future) { register_connection_read_timeout(@channel) })
|
118
115
|
else
|
119
116
|
@channel.write(message)
|
120
117
|
end
|
@@ -135,10 +132,6 @@ module Neo4j::Driver
|
|
135
132
|
end
|
136
133
|
end
|
137
134
|
|
138
|
-
def set_auto_read(value)
|
139
|
-
@channel.config.set_auto_read(value)
|
140
|
-
end
|
141
|
-
|
142
135
|
def verify_open(handler1, handler2)
|
143
136
|
connection_status = @status.get
|
144
137
|
|
@@ -2,26 +2,27 @@ module Neo4j::Driver
|
|
2
2
|
module Internal
|
3
3
|
module Handlers
|
4
4
|
class ChannelReleasingResetResponseHandler < ResetResponseHandler
|
5
|
-
def initialize(channel, pool, message_dispatcher,
|
5
|
+
def initialize(channel, pool, message_dispatcher, log, release_future)
|
6
6
|
super(message_dispatcher, release_future)
|
7
7
|
@channel = channel
|
8
8
|
@pool = pool
|
9
|
-
@
|
9
|
+
@log = log
|
10
10
|
end
|
11
11
|
|
12
|
-
def reset_completed(
|
12
|
+
def reset_completed(success)
|
13
13
|
if success
|
14
14
|
# update the last-used timestamp before returning the channel back to the pool
|
15
|
-
Async::Connection::ChannelAttributes.set_last_used_timestamp(@channel, @clock.millis)
|
16
|
-
closure_stage = Util::Futures.completed_with_null
|
15
|
+
# Async::Connection::ChannelAttributes.set_last_used_timestamp(@channel, @clock.millis)
|
16
|
+
# closure_stage = Util::Futures.completed_with_null
|
17
17
|
else
|
18
18
|
# close the channel before returning it back to the pool if RESET failed
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
closure_stage.exceptionally(-> (_throwable) { nil }).then_compose(-> (_ignored) { @pool.release(@channel) }).when_complete do |_, _error|
|
23
|
-
completion_future.complete(nil)
|
19
|
+
@channel.close
|
24
20
|
end
|
21
|
+
rescue
|
22
|
+
nil
|
23
|
+
ensure
|
24
|
+
@pool.release(@channel)
|
25
|
+
@log.debug { "Channel #{@channel.object_id} released." }
|
25
26
|
end
|
26
27
|
end
|
27
28
|
end
|
@@ -212,7 +212,7 @@ module Neo4j::Driver
|
|
212
212
|
|
213
213
|
def extract_result_summary(metadata)
|
214
214
|
result_available_after = @run_response_handler.result_available_after
|
215
|
-
@
|
215
|
+
@metadata_extractor.extract_summary(@query, @connection, result_available_after, metadata)
|
216
216
|
end
|
217
217
|
|
218
218
|
def enable_auto_read
|
@@ -4,7 +4,6 @@ module Neo4j::Driver
|
|
4
4
|
module Pulln
|
5
5
|
class AutoPullResponseHandler < BasicPullResponseHandler
|
6
6
|
delegate :signal, to: :@records
|
7
|
-
UNINITIALIZED_RECORDS = ::Async::Queue.new
|
8
7
|
LONG_MAX_VALUE = 2 ** 63 - 1
|
9
8
|
|
10
9
|
def initialize(query, run_response_handler, connection, metadata_extractor, completion_listener, fetch_size)
|
@@ -20,7 +19,7 @@ module Neo4j::Driver
|
|
20
19
|
@low_record_watermark = fetch_size * 0.3
|
21
20
|
end
|
22
21
|
|
23
|
-
@records =
|
22
|
+
@records = ::Async::Queue.new
|
24
23
|
@auto_pull_enabled = true
|
25
24
|
|
26
25
|
install_record_and_summary_consumers
|
@@ -7,7 +7,7 @@ module Neo4j::Driver
|
|
7
7
|
# delegate :verify_connectivity, to: :session_factory
|
8
8
|
delegate :metrics, :metrics_enabled?, to: :metrics_provider
|
9
9
|
auto_closable :session
|
10
|
-
sync :close, :supports_multi_db?, :verify_connectivity
|
10
|
+
sync :close, :supports_multi_db?, :verify_connectivity, :session
|
11
11
|
|
12
12
|
def initialize(security_plan, session_factory, metrics_provider, logger)
|
13
13
|
@closed = Concurrent::AtomicBoolean.new(false)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4j-ruby-driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.4.0.alpha.
|
4
|
+
version: 4.4.0.alpha.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Heinrich Klobuczek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -136,20 +136,6 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: parallel
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - ">="
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - ">="
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0'
|
153
139
|
- !ruby/object:Gem::Dependency
|
154
140
|
name: rake
|
155
141
|
requirement: !ruby/object:Gem::Requirement
|